mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-22 14:57:02 +01:00
scd: Fix ccid-driver timeout for OpenPGPcard v2.1.
* scd/ccid-driver.c (CCID_CMD_TIMEOUT): New. (ccid_transceive_apdu_level, ccid_transceive): Use. -- It is reported that key generation causes timeout with OpenPGPcard v2.1. Ideally, timeout value could be determined at run-time by examining card's ATR. Compile-time fixed value is OK for internal CCID driver. (cherry-picked from 2.1 6510df3a7cd2b5bf44fac1e4d50ee54b8c897daa)
This commit is contained in:
parent
d289341371
commit
a63fddad68
@ -109,6 +109,9 @@
|
|||||||
*/
|
*/
|
||||||
#define CCID_MAX_BUF (2048+7+10)
|
#define CCID_MAX_BUF (2048+7+10)
|
||||||
|
|
||||||
|
/* CCID command timeout. OpenPGPcard v2.1 requires timeout of 13 seconds. */
|
||||||
|
#define CCID_CMD_TIMEOUT (13*1000)
|
||||||
|
|
||||||
/* Depending on how this source is used we either define our error
|
/* Depending on how this source is used we either define our error
|
||||||
output to go to stderr or to the jnlib based logging functions. We
|
output to go to stderr or to the jnlib based logging functions. We
|
||||||
use the latter when GNUPG_MAJOR_VERSION is defines or when both,
|
use the latter when GNUPG_MAJOR_VERSION is defines or when both,
|
||||||
@ -2885,7 +2888,7 @@ ccid_transceive_apdu_level (ccid_driver_t handle,
|
|||||||
apdu_len -= apdu_part_len;
|
apdu_len -= apdu_part_len;
|
||||||
|
|
||||||
rc = bulk_in (handle, msg, sizeof msg, &msglen,
|
rc = bulk_in (handle, msg, sizeof msg, &msglen,
|
||||||
RDR_to_PC_DataBlock, seqno, 5000, 0);
|
RDR_to_PC_DataBlock, seqno, CCID_CMD_TIMEOUT, 0);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
@ -2920,7 +2923,7 @@ ccid_transceive_apdu_level (ccid_driver_t handle,
|
|||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rc = bulk_in (handle, msg, sizeof msg, &msglen,
|
rc = bulk_in (handle, msg, sizeof msg, &msglen,
|
||||||
RDR_to_PC_DataBlock, seqno, 5000, 0);
|
RDR_to_PC_DataBlock, seqno, CCID_CMD_TIMEOUT, 0);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -3129,7 +3132,7 @@ ccid_transceive (ccid_driver_t handle,
|
|||||||
msg = recv_buffer;
|
msg = recv_buffer;
|
||||||
rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen,
|
rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen,
|
||||||
via_escape? RDR_to_PC_Escape : RDR_to_PC_DataBlock,
|
via_escape? RDR_to_PC_Escape : RDR_to_PC_DataBlock,
|
||||||
seqno, 5000, 0);
|
seqno, CCID_CMD_TIMEOUT, 0);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user