diff --git a/src/KeePassLib2Android/Cryptography/KeyDerivation/AesKdf.cs b/src/KeePassLib2Android/Cryptography/KeyDerivation/AesKdf.cs index 0b82f94e..194b43d5 100644 --- a/src/KeePassLib2Android/Cryptography/KeyDerivation/AesKdf.cs +++ b/src/KeePassLib2Android/Cryptography/KeyDerivation/AesKdf.cs @@ -120,9 +120,15 @@ namespace KeePassLib.Cryptography.KeyDerivation try { // Try to use the native library first - if(NativeLib.TransformKey256(pbNewKey, pbKeySeed32, uNumRounds)) - return CryptoUtil.HashSha256(pbNewKey); + if (NativeLib.TransformKey256(pbNewKey, pbKeySeed32, uNumRounds)) + { + byte[] pbKey = new byte[32]; + Array.Copy(pbNewKey, pbKey, pbNewKey.Length); + + return pbKey; + } + if(TransformKeyManaged(pbNewKey, pbKeySeed32, uNumRounds)) return CryptoUtil.HashSha256(pbNewKey); }