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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KEEPASSXC_MOCKCHALLENGERESPONSEKEY_H
|
|
|
|
#define KEEPASSXC_MOCKCHALLENGERESPONSEKEY_H
|
|
|
|
|
|
|
|
#include "keys/ChallengeResponseKey.h"
|
|
|
|
|
|
|
|
/**
|
2018-03-01 15:25:29 -05:00
|
|
|
* Mock challenge-response key implementation that simply
|
|
|
|
* returns the challenge concatenated with a fixed secret.
|
2018-03-01 14:07:19 -05:00
|
|
|
*/
|
|
|
|
class MockChallengeResponseKey : public ChallengeResponseKey
|
|
|
|
{
|
|
|
|
public:
|
2018-03-01 15:25:29 -05:00
|
|
|
explicit MockChallengeResponseKey(const QByteArray& secret);
|
2018-05-13 17:21:43 -04:00
|
|
|
Q_DISABLE_COPY(MockChallengeResponseKey);
|
2018-03-01 14:07:19 -05:00
|
|
|
~MockChallengeResponseKey() override;
|
|
|
|
QByteArray rawKey() const override;
|
|
|
|
bool challenge(const QByteArray& challenge) override;
|
|
|
|
|
|
|
|
private:
|
2018-03-01 15:25:29 -05:00
|
|
|
QByteArray m_challenge;
|
|
|
|
QByteArray m_secret;
|
2018-03-01 14:07:19 -05:00
|
|
|
};
|
|
|
|
|
2018-03-31 16:01:30 -04:00
|
|
|
#endif // KEEPASSXC_MOCKCHALLENGERESPONSEKEY_H
|