|
|
@ -327,18 +327,21 @@ namespace pcsc { |
|
|
|
"Retry Nr. "<<cnt); |
|
|
|
"Retry Nr. "<<cnt); |
|
|
|
try { |
|
|
|
try { |
|
|
|
reconnect(); |
|
|
|
reconnect(); |
|
|
|
check(SCardTransmit(_id, &rPci, |
|
|
|
if (check(SCardTransmit(_id, &rPci, |
|
|
|
(LPCBYTE)in.c_str(), |
|
|
|
(LPCBYTE)in.c_str(), |
|
|
|
in.size(), |
|
|
|
in.size(), |
|
|
|
0, buff, &len), |
|
|
|
0, buff, &len), |
|
|
|
"smartcard transmit resend message "+crypto::hex(in)); |
|
|
|
"smartcard transmit resend message " |
|
|
|
|
|
|
|
+crypto::hex(in))) { |
|
|
|
|
|
|
|
CRYPTOLOG("successful after retry nr. "<<cnt); |
|
|
|
|
|
|
|
return std::string((char*)buff, len); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (std::exception& x) { |
|
|
|
} catch (std::exception& x) { |
|
|
|
CRYPTOLOG("failed with "<<x.what()); |
|
|
|
CRYPTOLOG("failed again with "<<x.what()); |
|
|
|
continue; // try again
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
break; // success
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
# endif |
|
|
|
# endif |
|
|
|
|
|
|
|
CRYPTOLOG("definitely failed with "<<x.what()); |
|
|
|
throw; // just rethrow otherwise
|
|
|
|
throw; // just rethrow otherwise
|
|
|
|
} |
|
|
|
} |
|
|
|
//CRYPTOLOG(" -> "<<crypto::hex(std::string((char*)buff, len)));
|
|
|
|
//CRYPTOLOG(" -> "<<crypto::hex(std::string((char*)buff, len)));
|
|
|
|