Apple Bug not resolved, retry more than once (up to 100 times); refs #34
This commit is contained in:
24
src/pcsc.hxx
24
src/pcsc.hxx
@@ -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);
|
||||||
check(SCardTransmit(_id, &rPci,
|
try {
|
||||||
(LPCBYTE)in.c_str(),
|
check(SCardTransmit(_id, &rPci,
|
||||||
in.size(),
|
(LPCBYTE)in.c_str(),
|
||||||
0, buff, &len),
|
in.size(),
|
||||||
"smartcard transmit message "+crypto::hex(in));
|
0, buff, &len),
|
||||||
|
"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);
|
||||||
|
Reference in New Issue
Block a user