From cf1c25f408ab73a70379f78e3f940121cd3f02b6 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Mon, 21 Oct 2019 16:56:26 +0200 Subject: [PATCH] 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. --- keepassxc-browser/background/keepass.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepassxc-browser/background/keepass.js b/keepassxc-browser/background/keepass.js index 9e15da1..6af1ae2 100755 --- a/keepassxc-browser/background/keepass.js +++ b/keepassxc-browser/background/keepass.js @@ -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; }