[Pcsclite-cvs-commit] r2404 - trunk/Drivers/ccid/src

Ludovic Rousseau rousseau at alioth.debian.org
Tue Feb 20 14:23:45 CET 2007


Author: rousseau
Date: 2007-02-20 14:23:44 +0100 (Tue, 20 Feb 2007)
New Revision: 2404

Modified:
   trunk/Drivers/ccid/src/commands.c
Log:
SecurePINModify(): the GemPC Twin does support different values of
bNumberMessages but all the bMsgIndex? must be present in the CCID
command


Modified: trunk/Drivers/ccid/src/commands.c
===================================================================
--- trunk/Drivers/ccid/src/commands.c	2007-02-19 09:16:29 UTC (rev 2403)
+++ trunk/Drivers/ccid/src/commands.c	2007-02-20 13:23:44 UTC (rev 2404)
@@ -355,6 +355,9 @@
 	_ccid_descriptor *ccid_descriptor = get_ccid_descriptor(reader_index);
 	int old_read_timeout;
 	RESPONSECODE ret;
+#ifdef BOGUS_PINPAD_FIRMWARE
+	int bNumberMessages = 0; /* for GemPC Pinpad */
+#endif
 
 	cmd[0] = 0x69;	/* Secure */
 	cmd[5] = ccid_descriptor->bCurrentSlotIndex;	/* slot number */
@@ -445,6 +448,7 @@
 		{
 			DEBUG_INFO2("Correct bNumberMessages for GemPC Pinpad (was %d)",
 				TxBuffer[11]);
+			bNumberMessages = TxBuffer[11];
 			TxBuffer[11] = 0x03; /* 3 messages */
 		}
 	}
@@ -519,6 +523,9 @@
 	{
 		cmd[21] = 0x00; /* set bNumberMessages to 0 */
 	}
+
+	if (GEMPCPINPAD == ccid_descriptor->readerID)
+		cmd[21] = bNumberMessages;	/* restore the real value */
 #endif
 
 	/* We know the size of the CCID message now */




More information about the Pcsclite-cvs-commit mailing list