[Pcsclite-cvs-commit] r4936 - /trunk/Drivers/ccid/src/commands.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Mon May 10 09:18:52 UTC 2010


Author: rousseau
Date: Mon May 10 09:18:50 2010
New Revision: 4936

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4936
Log:
SecurePINVerify() & SecurePINModify(): use min() instead of max() to get
a minimum of 30 seconds for the read timeout

Modified:
    trunk/Drivers/ccid/src/commands.c

Modified: trunk/Drivers/ccid/src/commands.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/commands.c?rev=4936&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/commands.c (original)
+++ trunk/Drivers/ccid/src/commands.c Mon May 10 09:18:50 2010
@@ -48,7 +48,6 @@
  * of 260 bytes since the driver check this value */
 #define BOGUS_SCM_FIRMWARE_FOR_dwMaxCCIDMessageLength
 
-#define max( a, b )   ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 
 /* internal functions */
@@ -447,7 +446,7 @@
 	i2dw(a - 10, cmd + 1);  /* CCID message length */
 
 	old_read_timeout = ccid_descriptor -> readTimeout;
-	ccid_descriptor -> readTimeout = max(30, TxBuffer[0]+10);	/* at least 30 seconds */
+	ccid_descriptor -> readTimeout = min(30, TxBuffer[0]+10);	/* at least 30 seconds */
 
 	if (WritePort(reader_index, a, cmd) != STATUS_SUCCESS)
 	{
@@ -675,7 +674,7 @@
 	i2dw(a - 10, cmd + 1);	/* command length (includes bPINOperation) */
 
 	old_read_timeout = ccid_descriptor -> readTimeout;
-	ccid_descriptor -> readTimeout = max(30, TxBuffer[0]+10);	/* at least 30 seconds */
+	ccid_descriptor -> readTimeout = min(30, TxBuffer[0]+10);	/* at least 30 seconds */
 
 	if (WritePort(reader_index, a, cmd) != STATUS_SUCCESS)
 	{




More information about the Pcsclite-cvs-commit mailing list