mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-10 10:35:17 -04:00
challenge: Propagate failed challenge to caller
* If a removed Yubikey is to blame, re-inserting the Yubikey won't resolve the issue. Hot plug isn't supported at this point. * The caller should detect the error and cancel the database write. Signed-off-by: Kyle Manna <kyle@kylemanna.com>
This commit is contained in:
parent
ba8fd25604
commit
faa055010f
6 changed files with 26 additions and 10 deletions
|
@ -113,9 +113,15 @@ Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& ke
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
QByteArray challengeResult;
|
||||
if (m_db->challengeMasterSeed(m_masterSeed, challengeResult) == false) {
|
||||
raiseError(tr("Unable to issue challenge-response."));
|
||||
return Q_NULLPTR;
|
||||
}
|
||||
|
||||
CryptoHash hash(CryptoHash::Sha256);
|
||||
hash.addData(m_masterSeed);
|
||||
hash.addData(m_db->challengeMasterSeed(m_masterSeed));
|
||||
hash.addData(challengeResult);
|
||||
hash.addData(m_db->transformedMasterKey());
|
||||
QByteArray finalKey = hash.result();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue