2018-03-01 14:07:19 -05:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 KeePassXC Team <team@keepassxc.org>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2018-10-31 23:27:38 -04:00
|
|
|
*/
|
2018-03-01 14:07:19 -05:00
|
|
|
|
|
|
|
#include "MockChallengeResponseKey.h"
|
|
|
|
|
2018-03-01 15:25:29 -05:00
|
|
|
MockChallengeResponseKey::MockChallengeResponseKey(const QByteArray& secret)
|
2018-05-13 17:21:43 -04:00
|
|
|
: ChallengeResponseKey(QUuid("aac5b480-cdc0-411e-9cb8-962062dcc1fd"))
|
|
|
|
, m_secret(secret)
|
2018-03-01 14:07:19 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
MockChallengeResponseKey::~MockChallengeResponseKey()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray MockChallengeResponseKey::rawKey() const
|
|
|
|
{
|
2018-03-01 15:25:29 -05:00
|
|
|
return m_challenge + m_secret;
|
2018-03-01 14:07:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bool MockChallengeResponseKey::challenge(const QByteArray& challenge)
|
|
|
|
{
|
2018-03-01 15:25:29 -05:00
|
|
|
m_challenge = challenge;
|
2018-03-01 14:07:19 -05:00
|
|
|
return true;
|
|
|
|
}
|