[Pcsclite-cvs-commit] r4897 - /trunk/Drivers/ccid/src/ifdhandler.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Sun Apr 25 19:09:21 UTC 2010


Author: rousseau
Date: Sun Apr 25 19:09:15 2010
New Revision: 4897

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4897
Log:
IFDHControl(): reuse ccid_descriptor variable when available

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

Modified: trunk/Drivers/ccid/src/ifdhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ifdhandler.c?rev=4897&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c (original)
+++ trunk/Drivers/ccid/src/ifdhandler.c Sun Apr 25 19:09:15 2010
@@ -1268,7 +1268,7 @@
 	if (IOCTL_SMARTCARD_VENDOR_IFD_EXCHANGE == dwControlCode)
 	{
 		int allowed = (DriverOptions & DRIVER_OPTION_CCID_EXCHANGE_AUTHORIZED);
-		int readerID = get_ccid_descriptor(reader_index) -> readerID;
+		int readerID = ccid_descriptor -> readerID;
 
 		if (VENDOR_GEMALTO == GET_VENDOR(readerID))
 		{
@@ -1312,15 +1312,14 @@
 	{
 		unsigned int iBytesReturned = 0;
 		PCSC_TLV_STRUCTURE *pcsc_tlv = (PCSC_TLV_STRUCTURE *)RxBuffer;
-		int readerID = get_ccid_descriptor(reader_index) -> readerID;
+		int readerID = ccid_descriptor -> readerID;
 
 		/* we need room for up to five records */
 		if (RxLength < 5 * sizeof(PCSC_TLV_STRUCTURE))
 			return IFD_ERROR_INSUFFICIENT_BUFFER;
 
 		/* We can only support direct verify and/or modify currently */
-		if (get_ccid_descriptor(reader_index) -> bPINSupport
-			& CCID_CLASS_PIN_VERIFY)
+		if (ccid_descriptor -> bPINSupport & CCID_CLASS_PIN_VERIFY)
 		{
 			pcsc_tlv -> tag = FEATURE_VERIFY_PIN_DIRECT;
 			pcsc_tlv -> length = 0x04; /* always 0x04 */
@@ -1330,8 +1329,7 @@
 			iBytesReturned += sizeof(PCSC_TLV_STRUCTURE);
 		}
 
-		if (get_ccid_descriptor(reader_index) -> bPINSupport
-			& CCID_CLASS_PIN_MODIFY)
+		if (ccid_descriptor -> bPINSupport & CCID_CLASS_PIN_MODIFY)
 		{
 			pcsc_tlv -> tag = FEATURE_MODIFY_PIN_DIRECT;
 			pcsc_tlv -> length = 0x04; /* always 0x04 */
@@ -1379,7 +1377,7 @@
 			return IFD_ERROR_INSUFFICIENT_BUFFER;
 
 		/* Only give the LCD size for now */
-		caps -> wLcdLayout = get_ccid_descriptor(reader_index) -> wLcdLayout;
+		caps -> wLcdLayout = ccid_descriptor -> wLcdLayout;
 		caps -> bEntryValidationCondition = 0x07; /* Default */
 		caps -> bTimeOut2 = 0x00; /* We do not distinguish bTimeOut from TimeOut2 */
 




More information about the Pcsclite-cvs-commit mailing list