mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-25 07:45:22 -04:00
Replace "Master Key" with "Database Credentials"
Definitions: * Database Key - Cryptographic hash used to perform encrypt/decrypt of the database. * Database Credentials - User facing term to refer to the collection of Password, Key File, and/or Hardware Key used to derive the Database Key. Changes: * Remove the term "master" and "key" from the user's lexicon and clarify the code base based on the definitions above. * Clean up wording in the UI to be clearer to the end user.
This commit is contained in:
parent
60bb593228
commit
3b459813ed
45 changed files with 162 additions and 162 deletions
|
@ -53,15 +53,15 @@ bool Kdbx4Writer::writeDatabase(QIODevice* device, Database* db)
|
|||
QByteArray endOfHeader = "\r\n\r\n";
|
||||
|
||||
if (!db->setKey(db->key(), false, true)) {
|
||||
raiseError(tr("Unable to calculate master key: %1").arg(db->keyError()));
|
||||
raiseError(tr("Unable to calculate database key: %1").arg(db->keyError()));
|
||||
return false;
|
||||
}
|
||||
|
||||
// generate transformed master key
|
||||
// generate transformed database key
|
||||
CryptoHash hash(CryptoHash::Sha256);
|
||||
hash.addData(masterSeed);
|
||||
Q_ASSERT(!db->transformedMasterKey().isEmpty());
|
||||
hash.addData(db->transformedMasterKey());
|
||||
Q_ASSERT(!db->transformedDatabaseKey().isEmpty());
|
||||
hash.addData(db->transformedDatabaseKey());
|
||||
QByteArray finalKey = hash.result();
|
||||
|
||||
// write header
|
||||
|
@ -109,7 +109,7 @@ bool Kdbx4Writer::writeDatabase(QIODevice* device, Database* db)
|
|||
QByteArray headerHash = CryptoHash::hash(headerData, CryptoHash::Sha256);
|
||||
|
||||
// write HMAC-authenticated cipher stream
|
||||
QByteArray hmacKey = KeePass2::hmacKey(masterSeed, db->transformedMasterKey());
|
||||
QByteArray hmacKey = KeePass2::hmacKey(masterSeed, db->transformedDatabaseKey());
|
||||
QByteArray headerHmac =
|
||||
CryptoHash::hmac(headerData, HmacBlockStream::getHmacKey(UINT64_MAX, hmacKey), CryptoHash::Sha256);
|
||||
CHECK_RETURN_FALSE(writeData(device, headerHash));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue