keys: CompositeKey: Add ChallengeResponseKey support

* Each Challenge Response Key consists of a list of regular keys and now
  challenge response keys.
* Copy ChallengeResponseKeys when copying the object.
* Challenge consists of challenging each driver in the list and hashing
  the concatenated data result using SHA256.

Signed-off-by: Kyle Manna <kyle@kylemanna.com>
This commit is contained in:
Kyle Manna
2014-05-26 01:38:07 -07:00
parent 9bdb41a727
commit ccd6704b8f
2 changed files with 34 additions and 1 deletions

View File

@@ -21,6 +21,7 @@
#include <QList>
#include "keys/Key.h"
#include "keys/ChallengeResponseKey.h"
class CompositeKey : public Key
{
@@ -36,7 +37,10 @@ public:
QByteArray rawKey() const;
QByteArray transform(const QByteArray& seed, quint64 rounds,
bool* ok, QString* errorString) const;
QByteArray challenge(const QByteArray& seed) const;
void addKey(const Key& key);
void addChallengeResponseKey(const ChallengeResponseKey& key);
static int transformKeyBenchmark(int msec);
@@ -45,6 +49,7 @@ private:
quint64 rounds, bool* ok, QString* errorString);
QList<Key*> m_keys;
QList<ChallengeResponseKey*> m_challengeResponseKeys;
};
#endif // KEEPASSX_COMPOSITEKEY_H