Explicitly support AES-KDF in KDBX4 and don't convert KDBX4 files with AES-KDF back to KDBX3 when saving

This commit is contained in:
Janek Bevendorff
2018-01-10 21:24:53 +01:00
committed by Jonathan White
parent d327c16904
commit b04c8c2b6e
9 changed files with 59 additions and 26 deletions

View File

@@ -22,6 +22,7 @@
#include <format/KeePass2.h>
#include "core/Global.h"
#include "crypto/kdf/AesKdf.h"
#include "crypto/CryptoHash.h"
CompositeKey::CompositeKey()
@@ -130,7 +131,7 @@ QByteArray CompositeKey::rawKey(const QByteArray* transformSeed) const
*/
bool CompositeKey::transform(const Kdf& kdf, QByteArray& result) const
{
if (kdf.uuid() == KeePass2::KDF_AES) {
if (kdf.uuid() == KeePass2::KDF_AES_KDBX3) {
// legacy KDBX3 AES-KDF, challenge response is added later to the hash
return kdf.transform(rawKey(), result);
}