Remember if challenge-response was used for each database and allow to re-detect Yubikeys without closing the database first

This commit is contained in:
Janek Bevendorff
2017-02-20 22:07:01 +01:00
parent 7174549441
commit eb23dda99b
5 changed files with 71 additions and 12 deletions

View File

@@ -117,7 +117,6 @@ bool YubiKey::deinit()
void YubiKey::detect()
{
if (init()) {
for (int i = 1; i < 3; i++) {
YubiKey::ChallengeResult result;
QByteArray rand = randomGen()->randomArray(1);
@@ -126,10 +125,12 @@ void YubiKey::detect()
result = challenge(i, false, rand, resp);
if (result != YubiKey::ERROR) {
Q_EMIT detected(i, result == YubiKey::WOULDBLOCK ? true : false);
emit detected(i, result == YubiKey::WOULDBLOCK ? true : false);
return;
}
}
}
emit notFound();
}
/**