mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-25 07:00:52 -04:00
Fix challenge-response key data after Botan
* Fix #6420 * Refactor Challenge-Response key files to be more streamlined. Added a test to confirm raw key data is accurate.
This commit is contained in:
parent
60adcacaaa
commit
fd0bdaae80
14 changed files with 65 additions and 108 deletions
|
@ -18,22 +18,18 @@
|
|||
#include "MockChallengeResponseKey.h"
|
||||
|
||||
MockChallengeResponseKey::MockChallengeResponseKey(const QByteArray& secret)
|
||||
: ChallengeResponseKey(QUuid("aac5b480-cdc0-411e-9cb8-962062dcc1fd"))
|
||||
: ChallengeResponseKey()
|
||||
, m_secret(secret)
|
||||
{
|
||||
}
|
||||
|
||||
MockChallengeResponseKey::~MockChallengeResponseKey()
|
||||
QByteArray MockChallengeResponseKey::rawKey() const
|
||||
{
|
||||
return m_challenge + m_secret;
|
||||
}
|
||||
|
||||
bool MockChallengeResponseKey::challenge(const QByteArray& challenge)
|
||||
{
|
||||
m_challenge = challenge;
|
||||
|
||||
auto response = m_challenge + m_secret;
|
||||
m_key.resize(response.size());
|
||||
std::copy(response.begin(), response.end(), m_key.data());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue