[git] GnuPG - branch, master, updated. gnupg-2.1.8-32-g6510df3
by NIIBE Yutaka
cvs at cvs.gnupg.org
Thu Sep 17 04:31:25 CEST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via 6510df3a7cd2b5bf44fac1e4d50ee54b8c897daa (commit)
from 93d257c81952cbb08a744a9cea6749639aa32cd7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6510df3a7cd2b5bf44fac1e4d50ee54b8c897daa
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Thu Sep 17 11:21:44 2015 +0900
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.
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index fe1f679..5a1a243 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -107,6 +107,9 @@
*/
#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
output to go to stderr or to the GnuPG based logging functions. We
use the latter when GNUPG_MAJOR_VERSION or GNUPG_SCD_MAIN_HEADER
@@ -2846,7 +2849,7 @@ ccid_transceive_apdu_level (ccid_driver_t handle,
apdu_len -= apdu_part_len;
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)
return rc;
@@ -2881,7 +2884,7 @@ ccid_transceive_apdu_level (ccid_driver_t handle,
return rc;
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)
return rc;
}
@@ -3090,7 +3093,7 @@ ccid_transceive (ccid_driver_t handle,
msg = recv_buffer;
rc = bulk_in (handle, msg, sizeof recv_buffer, &msglen,
via_escape? RDR_to_PC_Escape : RDR_to_PC_DataBlock,
- seqno, 5000, 0);
+ seqno, CCID_CMD_TIMEOUT, 0);
if (rc)
return rc;
-----------------------------------------------------------------------
Summary of changes:
scd/ccid-driver.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list