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

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Tue Jan 7 14:12:27 UTC 2014


Author: rousseau
Date: 2014-01-07 14:12:27 +0000 (Tue, 07 Jan 2014)
New Revision: 6819

Modified:
   trunk/Drivers/ccid/src/ifdhandler.c
Log:
Support Gemalto features for pinpad readers

MinimumPINSize, MaximumPINSize and bEntryValidationCondition are fetched
from the reader firmware.
No need to hardcode specific values anymore.


Modified: trunk/Drivers/ccid/src/ifdhandler.c
===================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c	2014-01-07 10:16:28 UTC (rev 6818)
+++ trunk/Drivers/ccid/src/ifdhandler.c	2014-01-07 14:12:27 UTC (rev 6819)
@@ -1495,6 +1495,8 @@
 
 		/* Only give the LCD size for now */
 		caps -> wLcdLayout = ccid_descriptor -> wLcdLayout;
+
+		/* Hardcoded special reader cases */
 		switch (ccid_descriptor->readerID)
 		{
 			case GEMPCPINPAD:
@@ -1506,6 +1508,10 @@
 				validation = 0x07; /* Default */
 		}
 
+		/* Gemalto readers providing firmware features */
+		if (ccid_descriptor -> gemalto_firmware_features)
+			validation = ccid_descriptor -> gemalto_firmware_features -> bEntryValidationCondition;
+
 		caps -> bEntryValidationCondition = validation;
 		caps -> bTimeOut2 = 0x00; /* We do not distinguish bTimeOut from TimeOut2 */
 
@@ -1571,7 +1577,8 @@
 		}
 
 		/* Gemalto PC Pinpad V1 */
-		if ((GEMPCPINPAD == ccid_descriptor -> readerID)
+		if (((GEMPCPINPAD == ccid_descriptor -> readerID)
+			&& (0x0100 == ccid_descriptor -> IFD_bcdDevice))
 			/* Covadis Véga-Alpha */
 			|| (VEGAALPHA == ccid_descriptor->readerID))
 		{
@@ -1610,6 +1617,27 @@
 			RxBuffer[p++] = 0x02;	/* validation key pressed */
 		}
 
+		/* Gemalto readers providing firmware features */
+		if (ccid_descriptor -> gemalto_firmware_features)
+		{
+			struct GEMALTO_FIRMWARE_FEATURES *features = ccid_descriptor -> gemalto_firmware_features;
+
+			/* bMinPINSize */
+			RxBuffer[p++] = PCSCv2_PART10_PROPERTY_bMinPINSize;
+			RxBuffer[p++] = 1;	/* length */
+			RxBuffer[p++] = features -> MinimumPINSize;	/* min PIN size */
+
+			/* bMaxPINSize */
+			RxBuffer[p++] = PCSCv2_PART10_PROPERTY_bMaxPINSize;
+			RxBuffer[p++] = 1;	/* length */
+			RxBuffer[p++] = features -> MaximumPINSize;	/* max PIN size */
+
+			/* bEntryValidationCondition */
+			RxBuffer[p++] = PCSCv2_PART10_PROPERTY_bEntryValidationCondition;
+			RxBuffer[p++] = 1;	/* length */
+			RxBuffer[p++] = features -> bEntryValidationCondition;	/* validation key pressed */
+		}
+
 		/* bPPDUSupport */
 		RxBuffer[p++] = PCSCv2_PART10_PROPERTY_bPPDUSupport;
 		RxBuffer[p++] = 1;	/* length */




More information about the Pcsclite-cvs-commit mailing list