mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 07:19:42 -05:00
Retain number of rounds when auto-upgrading KDBX version
This commit is contained in:
parent
c94efe6b5c
commit
67603ab42e
@ -110,7 +110,9 @@ bool KeePass2Writer::writeDatabase(QIODevice* device, Database* db)
|
||||
if (upgradeNeeded) {
|
||||
// We MUST re-transform the key, because challenge-response hashing has changed in KDBX 4.
|
||||
// If we forget to re-transform, the database will be saved WITHOUT a challenge-response key component!
|
||||
db->changeKdf(KeePass2::uuidToKdf(KeePass2::KDF_AES_KDBX4));
|
||||
auto kdf = KeePass2::uuidToKdf(KeePass2::KDF_AES_KDBX4);
|
||||
kdf->setRounds(db->kdf()->rounds());
|
||||
db->changeKdf(kdf);
|
||||
}
|
||||
|
||||
if (db->kdf()->uuid() == KeePass2::KDF_AES_KDBX3) {
|
||||
|
Loading…
Reference in New Issue
Block a user