[Pcsclite-cvs-commit] r1704 - trunk/Drivers/ccid/src
Ludovic Rousseau
rousseau at costa.debian.org
Tue Nov 15 11:04:08 UTC 2005
Author: rousseau
Date: 2005-11-15 11:04:07 +0000 (Tue, 15 Nov 2005)
New Revision: 1704
Modified:
trunk/Drivers/ccid/src/commands.c
Log:
SecurePINModify(): set the readTimeout to at least 30 seconds since we
are not waiting after an APDU but after a human (after the reader in
fact).
Modified: trunk/Drivers/ccid/src/commands.c
===================================================================
--- trunk/Drivers/ccid/src/commands.c 2005-11-07 15:46:03 UTC (rev 1703)
+++ trunk/Drivers/ccid/src/commands.c 2005-11-15 11:04:07 UTC (rev 1704)
@@ -264,6 +264,8 @@
unsigned char cmd[11+19+CMD_BUF_SIZE];
unsigned int a, b;
_ccid_descriptor *ccid_descriptor = get_ccid_descriptor(reader_index);
+ int old_read_timeout;
+ RESPONSECODE ret;
cmd[0] = 0x69; /* Secure */
cmd[5] = ccid_descriptor->bCurrentSlotIndex; /* slot number */
@@ -337,10 +339,16 @@
/* We know the size of the CCID message now */
i2dw(a - 10, cmd + 1); /* command length (includes bPINOperation) */
+ old_read_timeout = ccid_descriptor -> readTimeout;
+ ccid_descriptor -> readTimeout = max(30, TxBuffer[0]); /* at least 30 seconds */
+
if (WritePort(reader_index, a, cmd) != STATUS_SUCCESS)
return IFD_COMMUNICATION_ERROR;
- return CCID_Receive(reader_index, RxLength, RxBuffer);
+ ret = CCID_Receive(reader_index, RxLength, RxBuffer);
+
+ ccid_descriptor -> readTimeout = old_read_timeout;
+ return ret;
} /* SecurePINModify */
More information about the Pcsclite-cvs-commit
mailing list