mirror of git://git.gnupg.org/gnupg.git
scd: Handle CCID bwi of time extension.
* scd/ccid-driver.c (bulk_in): Increase timeout by the multiplier value as defined section 6.2.6 in CCID specification. -- For TPDU level transfer, it was handled. This is fix for APDU level transfer. GnuPG-bug-id: 4646 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
858dc95643
commit
996c497a86
|
@ -1940,6 +1940,7 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
|
||||||
int rc;
|
int rc;
|
||||||
int msglen;
|
int msglen;
|
||||||
int notified = 0;
|
int notified = 0;
|
||||||
|
int bwi = 1;
|
||||||
|
|
||||||
/* Fixme: The next line for the current Valgrind without support
|
/* Fixme: The next line for the current Valgrind without support
|
||||||
for USB IOCTLs. */
|
for USB IOCTLs. */
|
||||||
|
@ -1950,7 +1951,7 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
|
||||||
npth_unprotect ();
|
npth_unprotect ();
|
||||||
#endif
|
#endif
|
||||||
rc = libusb_bulk_transfer (handle->idev, handle->ep_bulk_in,
|
rc = libusb_bulk_transfer (handle->idev, handle->ep_bulk_in,
|
||||||
buffer, length, &msglen, timeout);
|
buffer, length, &msglen, bwi*timeout);
|
||||||
#ifdef USE_NPTH
|
#ifdef USE_NPTH
|
||||||
npth_protect ();
|
npth_protect ();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1998,6 +1999,10 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
|
||||||
DEBUGOUT_2 ("time extension requested (%02X,%02X)\n",
|
DEBUGOUT_2 ("time extension requested (%02X,%02X)\n",
|
||||||
buffer[7], buffer[8]);
|
buffer[7], buffer[8]);
|
||||||
|
|
||||||
|
bwi = 1;
|
||||||
|
if (buffer[8] != 0 && buffer[8] != 0xff)
|
||||||
|
bwi = buffer[8];
|
||||||
|
|
||||||
/* Gnuk enhancement to prompt user input by ack button */
|
/* Gnuk enhancement to prompt user input by ack button */
|
||||||
if (buffer[8] == 0xff && !notified)
|
if (buffer[8] == 0xff && !notified)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue