Do not overwrite keyRing element with itself

Using KeePassXC 2.5.0 with a database created with KeePassXC 2.5.0,
decrypted messages from keepassxc-proxy contain an 'oldHash' and a
'hash' value that are equal. In that case, we must not try to replace
the database hash ID in the keyRing with itself, as it effectively leads
to the keyRing entry to be destroyed without replacement when using the
current implementation.
This commit is contained in:
Bernhard Kirchen 2019-10-21 16:56:26 +02:00
parent c86c44adf0
commit cf1c25f408

View file

@ -851,7 +851,7 @@ keepass.updateLastUsed = function(hash) {
};
// Update the databaseHash from legacy hash
keepass.updateDatabaseHash = function(oldHash, newHash) {
if (!oldHash || !newHash) {
if (!oldHash || !newHash || oldHash === newHash) {
return;
}