1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* configure.ac: Required newer versions of some libraries.

* 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.
This commit is contained in:
Werner Koch 2003-09-06 13:23:48 +00:00
parent 25430119e8
commit be034cf34c
10 changed files with 58 additions and 38 deletions

View file

@ -1,3 +1,10 @@
2003-09-06 Werner Koch <wk@gnupg.org>
* 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 <wk@gnupg.org>
* ccid-driver.c: More work, data can now actually be retrieved.

View file

@ -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;
}

View file

@ -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. */

View file

@ -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");