From dc345ccf9af9540b34016304e8e860215999fae2 Mon Sep 17 00:00:00 2001 From: sainaen Date: Tue, 4 Jul 2017 22:01:07 +0300 Subject: [PATCH] Properly retry Yubikey's challenge in case of an error Fixes #712 --- src/keys/YkChallengeResponseKey.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/keys/YkChallengeResponseKey.cpp b/src/keys/YkChallengeResponseKey.cpp index cfb4a1dfe7..935eb0224b 100644 --- a/src/keys/YkChallengeResponseKey.cpp +++ b/src/keys/YkChallengeResponseKey.cpp @@ -58,8 +58,6 @@ bool YkChallengeResponseKey::challenge(const QByteArray& challenge, unsigned ret Q_ASSERT(retries > 0); do { - --retries; - if (m_blocking) { emit userInteractionRequired(); } @@ -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; }