mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Fix force conversion of KDBX3 if using Quick Unlock
* Use SHA256 hash of the file path of the database to generate a UUID when using the KDBX3 format. This restores the original behavior of using the file path as the quick unlock lookup key.
This commit is contained in:
parent
f80e79f71a
commit
dd1a233859
@ -1041,6 +1041,13 @@ void Database::stopModifiedTimer()
|
||||
|
||||
QUuid Database::publicUuid()
|
||||
{
|
||||
// This feature requires KDBX4
|
||||
if (m_data.formatVersion < KeePass2::FILE_VERSION_4) {
|
||||
// Return the file path hash as a UUID for KDBX3
|
||||
QCryptographicHash hasher(QCryptographicHash::Sha256);
|
||||
hasher.addData(filePath().toUtf8());
|
||||
return QUuid::fromRfc4122(hasher.result().left(16));
|
||||
}
|
||||
|
||||
if (!publicCustomData().contains("KPXC_PUBLIC_UUID")) {
|
||||
publicCustomData().insert("KPXC_PUBLIC_UUID", QUuid::createUuid().toRfc4122());
|
||||
|
Loading…
Reference in New Issue
Block a user