|
|
@ -320,22 +320,28 @@ namespace pcsc { |
|
|
|
reconnect, first transaction (SCardTransmit) |
|
|
|
reconnect, first transaction (SCardTransmit) |
|
|
|
fails with SCARD_W_RESET_CARD |
|
|
|
fails with SCARD_W_RESET_CARD |
|
|
|
(0x80100068). */ |
|
|
|
(0x80100068). */ |
|
|
|
if (_state==SCARD_W_RESET_CARD) { // just resend once
|
|
|
|
for (int bugCnt(0); |
|
|
|
|
|
|
|
bugCnt<100 && _state==SCARD_W_RESET_CARD; |
|
|
|
|
|
|
|
++bugCnt) { // just try to resend
|
|
|
|
CRYPTOLOG("Mac OS X 10.10 implementation bug: " |
|
|
|
CRYPTOLOG("Mac OS X 10.10 implementation bug: " |
|
|
|
"On Mac OSX 10.10 there is a bug in " |
|
|
|
"On Mac OSX 10.10 there is a bug in " |
|
|
|
"PCSC: After a reconnect, first " |
|
|
|
"PCSC: After a reconnect, first " |
|
|
|
"transaction (SCardTransmit) fails " |
|
|
|
"transaction (SCardTransmit) fails " |
|
|
|
"with SCARD_W_RESET_CARD (0x80100068). " |
|
|
|
"with SCARD_W_RESET_CARD (0x80100068). " |
|
|
|
"Retry once."); |
|
|
|
"Retry Nr. "<<bugCnt); |
|
|
|
|
|
|
|
try { |
|
|
|
check(SCardTransmit(_id, &rPci, |
|
|
|
check(SCardTransmit(_id, &rPci, |
|
|
|
(LPCBYTE)in.c_str(), |
|
|
|
(LPCBYTE)in.c_str(), |
|
|
|
in.size(), |
|
|
|
in.size(), |
|
|
|
0, buff, &len), |
|
|
|
0, buff, &len), |
|
|
|
"smartcard transmit message "+crypto::hex(in)); |
|
|
|
"smartcard transmit resend message "+crypto::hex(in)); |
|
|
|
|
|
|
|
} catch (...) { |
|
|
|
|
|
|
|
continue; // try again
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; // success
|
|
|
|
} |
|
|
|
} |
|
|
|
# else |
|
|
|
|
|
|
|
throw; // just rethrow otherwise
|
|
|
|
|
|
|
|
# endif |
|
|
|
# endif |
|
|
|
|
|
|
|
throw; // just rethrow otherwise
|
|
|
|
} |
|
|
|
} |
|
|
|
//CRYPTOLOG(" -> "<<crypto::hex(std::string((char*)buff, len)));
|
|
|
|
//CRYPTOLOG(" -> "<<crypto::hex(std::string((char*)buff, len)));
|
|
|
|
return std::string((char*)buff, len); |
|
|
|
return std::string((char*)buff, len); |
|
|
|