Add challenge response to key before transformation, resolves #1060

* Re-implement KDBX4 challenge-response key assembly with transform
seed instead of master seed
This commit is contained in:
Janek Bevendorff 2018-01-07 18:46:24 +01:00 committed by Jonathan White
parent a6ddc22fb8
commit df728083cc
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
5 changed files with 67 additions and 18 deletions

View file

@ -255,10 +255,19 @@ void Database::setCompressionAlgo(Database::CompressionAlgorithm algo)
m_data.compressionAlgo = algo;
}
/**
* Set and transform a new encryption key.
*
* @param key key to set and transform
* @param updateChangedTime true to update database change time
* @param updateTransformSalt true to update the transform salt
* @return true on success
*/
bool Database::setKey(const CompositeKey& key, bool updateChangedTime, bool updateTransformSalt)
{
if (updateTransformSalt) {
m_data.kdf->randomizeSeed();
Q_ASSERT(!m_data.kdf->seed().isEmpty());
}
QByteArray oldTransformedMasterKey = m_data.transformedMasterKey;