aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2020-09-28 06:52:42 +0000
committerNIIBE Yutaka <[email protected]>2020-10-06 02:43:48 +0000
commit498cd38019b8122824d69fd194675ab532501423 (patch)
treec879a857030e4243eb43d18d9f4979d9f26eb2bf
parentscd: Change handling of SPR532 card reader. (diff)
downloadgnupg-498cd38019b8122824d69fd194675ab532501423.tar.gz
gnupg-498cd38019b8122824d69fd194675ab532501423.zip
scd: Internal CCID: Handle LIBUSB_ERROR_TIMEOUT at ccid_get_atr.
* scd/ccid-driver.c (ccid_slot_status): Handle LIBUSB_ERROR_TIMEOUT. -- Backport master commit of: b1e8072320c19246962beb6d67dc5784b5a72364 With SPR532, at the first connection, it fails by LIBUSB_ERROR_TIMEOUT, but no retry. Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--scd/ccid-driver.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index ab4d100c9..c76695061 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -2455,7 +2455,8 @@ ccid_slot_status (ccid_driver_t handle, int *statusbits, int on_wire)
status and debugging enabled. */
rc = bulk_in (handle, msg, sizeof msg, &msglen, RDR_to_PC_SlotStatus,
seqno, retries? 1000 : 200, 1);
- if (rc == CCID_DRIVER_ERR_CARD_IO_ERROR && retries < 3)
+ if ((rc == CCID_DRIVER_ERR_CARD_IO_ERROR || rc == CCID_DRIVER_ERR_USB_TIMEOUT)
+ && retries < 3)
{
if (!retries)
{