aboutsummaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2003-09-06 13:23:48 +0000
committerWerner Koch <[email protected]>2003-09-06 13:23:48 +0000
commitbe034cf34c3c5bc7787d9b2f8d4c7b6b948d4e2f (patch)
treea35573c9fe82e0b9e5ce804b344a984f901e17ea /scd
parent* ccid-driver.c: More work, data can now actually be retrieved. (diff)
downloadgnupg-be034cf34c3c5bc7787d9b2f8d4c7b6b948d4e2f.tar.gz
gnupg-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')
-rw-r--r--scd/ChangeLog7
-rw-r--r--scd/apdu.c18
-rw-r--r--scd/ccid-driver.c26
-rw-r--r--scd/scdaemon.c3
4 files changed, 28 insertions, 26 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog
index 5ffad3440..1c785b215 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -1,3 +1,10 @@
+2003-09-06 Werner Koch <[email protected]>
+
+ * 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.
+
2003-09-05 Werner Koch <[email protected]>
* ccid-driver.c: More work, data can now actually be retrieved.
diff --git a/scd/apdu.c b/scd/apdu.c
index 4867f10ff..d5f64c6d8 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -823,8 +823,8 @@ osc_send_apdu (int slot, unsigned char *apdu, size_t apdulen,
/* Open the reader and return an internal slot number or -1 on
error. If PORTSTR is NULL we default to a suitable port (for ctAPI:
- the first USB reader. For PC/SC the first listed reader). IF
- OpenSC support is cmpiled in, we first try to use OpenSC. */
+ the first USB reader. For PC/SC the first listed reader). If
+ OpenSC support is compiled in, we first try to use OpenSC. */
int
apdu_open_reader (const char *portstr)
{
@@ -839,7 +839,7 @@ apdu_open_reader (const char *portstr)
if (slot != -1)
return slot; /* got one */
}
-#endif
+#endif /* HAVE_LIBUSB */
#ifdef HAVE_OPENSC
if (!opt.disable_opensc)
@@ -886,17 +886,11 @@ apdu_open_reader (const char *portstr)
{
void *handle;
- if (!opt.pcsc_driver || !*opt.pcsc_driver)
- {
- log_error ("no PC/SC driver has been specified\n");
- return -1;
- }
-
- handle = dlopen ("libpcsclite.so", RTLD_LAZY);
+ handle = dlopen (opt.pcsc_driver, RTLD_LAZY);
if (!handle)
{
- log_error ("apdu_open_reader: failed to open driver: %s",
- dlerror ());
+ log_error ("apdu_open_reader: failed to open driver `%s': %s",
+ opt.pcsc_driver, dlerror ());
return -1;
}
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. */
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index fda0bed6f..89be04ab5 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -277,8 +277,7 @@ main (int argc, char **argv )
may_coredump = disable_core_dumps ();
/* Set default options. */
- opt.pcsc_driver = NULL; /* We can't use libpcsclite due to license
- conflicts. */
+ opt.pcsc_driver = "libpcsclite.so";
shell = getenv ("SHELL");