Skip to content

Commit

Permalink
Properly retry Yubikey's challenge in case of an error
Browse files Browse the repository at this point in the history
  • Loading branch information
sainaen committed Jul 4, 2017
1 parent caa49a8 commit dc345cc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/keys/YkChallengeResponseKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ bool YkChallengeResponseKey::challenge(const QByteArray& challenge, unsigned ret
Q_ASSERT(retries > 0);

do {
--retries;

if (m_blocking) {
emit userInteractionRequired();
}
Expand All @@ -83,11 +81,8 @@ bool YkChallengeResponseKey::challenge(const QByteArray& challenge, unsigned ret
}

// if challenge failed, retry to detect YubiKeys in the event the YubiKey was un-plugged and re-plugged
if (retries > 0 && YubiKey::instance()->init() != true) {
continue;
}

} while (retries > 0);
YubiKey::instance()->init();
} while (retries-- > 0);

return false;
}
Expand Down

0 comments on commit dc345cc

Please sign in to comment.