YubiKey: Retry to recover hotplugging

* Attempt one retry in the event the event the device was removed and
  re-inserted.

Signed-off-by: Kyle Manna <kyle@kylemanna.com>
This commit is contained in:
Kyle Manna
2014-09-06 22:09:06 -07:00
parent faa055010f
commit f7ee528d41
3 changed files with 29 additions and 1 deletions

View File

@@ -182,6 +182,11 @@ YubiKey::ChallengeResult YubiKey::challenge(int slot, bool mayBlock,
int yk_cmd = (slot == 1) ? SLOT_CHAL_HMAC1 : SLOT_CHAL_HMAC2;
QByteArray paddedChal = chal;
/* Ensure that YubiKey::init() succeeded */
if (m_yk == NULL) {
return ERROR;
}
/* yk_challenge_response() insists on 64 byte response buffer */
resp.resize(64);