summaryrefslogtreecommitdiffstats
path: root/scd/ccid-driver.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2003-09-06 15:23:48 +0200
committerWerner Koch <wk@gnupg.org>2003-09-06 15:23:48 +0200
commitbe034cf34c3c5bc7787d9b2f8d4c7b6b948d4e2f (patch)
treea35573c9fe82e0b9e5ce804b344a984f901e17ea /scd/ccid-driver.c
parent* ccid-driver.c: More work, data can now actually be retrieved. (diff)
downloadgnupg2-be034cf34c3c5bc7787d9b2f8d4c7b6b948d4e2f.tar.xz
gnupg2-be034cf34c3c5bc7787d9b2f8d4c7b6b948d4e2f.zip
* configure.ac: Required newer versions of some libraries.V1-9-1
* misc.c (openpgp_pk_algo_usage): Allow AUTH where SIGN is allowed. * keygen.c (ask_passphrase): No need to allocated S2K in secure memory. * scdaemon.c (main): --pcsc-driver again defaults to pcsclite. David Corcoran was so kind to remove the GPL incompatible advertisng clause from pcsclite. * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
Diffstat (limited to 'scd/ccid-driver.c')
-rw-r--r--scd/ccid-driver.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index b18b055b0..6f469de6a 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -286,7 +286,9 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
rc = usb_bulk_read (handle->idev,
0x82,
buffer, length,
- 1000 /* ms timeout */ );
+ 10000 /* ms timeout */ );
+ /* Fixme: instead of using a 10 second timeout we should better
+ handle the timeout here and retry if appropriate. */
if (rc < 0)
{
DEBUGOUT_1 ("usb_bulk_read error: %s\n", strerror (errno));
@@ -556,10 +558,10 @@ ccid_transceive (ccid_driver_t handle,
DEBUGOUT_CONT_1 (" %02X", msg[i]);
DEBUGOUT_LF ();
- fprintf (stderr, "T1: put %c-block seq=%d\n",
- ((msg[11] & 0xc0) == 0x80)? 'R' :
- (msg[11] & 0x80)? 'S' : 'I',
- ((msg[11] & 0x80)? !!(msg[11]& 0x10) : !!(msg[11] & 0x40)));
+/* fprintf (stderr, "T1: put %c-block seq=%d\n", */
+/* ((msg[11] & 0xc0) == 0x80)? 'R' : */
+/* (msg[11] & 0x80)? 'S' : 'I', */
+/* ((msg[11] & 0x80)? !!(msg[11]& 0x10) : !!(msg[11] & 0x40))); */
rc = bulk_out (handle, msg, msglen);
if (rc)
@@ -576,16 +578,16 @@ ccid_transceive (ccid_driver_t handle,
if (tpdulen < 4)
{
- DEBUGOUT ("cannot yet handle short block!!\n");
+ DEBUGOUT ("cannot yet handle short blocks!\n");
return -1;
}
- fprintf (stderr, "T1: got %c-block seq=%d err=%d\n",
- ((msg[11] & 0xc0) == 0x80)? 'R' :
- (msg[11] & 0x80)? 'S' : 'I',
- ((msg[11] & 0x80)? !!(msg[11]& 0x10) : !!(msg[11] & 0x40)),
- ((msg[11] & 0xc0) == 0x80)? (msg[11] & 0x0f) : 0
- );
+/* fprintf (stderr, "T1: got %c-block seq=%d err=%d\n", */
+/* ((msg[11] & 0xc0) == 0x80)? 'R' : */
+/* (msg[11] & 0x80)? 'S' : 'I', */
+/* ((msg[11] & 0x80)? !!(msg[11]& 0x10) : !!(msg[11] & 0x40)), */
+/* ((msg[11] & 0xc0) == 0x80)? (msg[11] & 0x0f) : 0 */
+/* ); */
if (!(tpdu[1] & 0x80))
{ /* This is an I-block. */