[Pcsclite-cvs-commit] Drivers/ccid/src ifdhandler.c,1.31,1.32 ccid_usb.c,1.25,1.26 ccid_serial.c,1.11,1.12 ccid.h,1.5,1.6

rousseau@haydn.debian.org rousseau@haydn.debian.org


Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv3863/src

Modified Files:
	ifdhandler.c ccid_usb.c ccid_serial.c ccid.h 
Log Message:
add support for SCardGetAttrib(.., IOCTL_SMARTCARD_VENDOR_VERIFY_PIN, ..)
to know if the reader supports SCardControl(.., IOCTL_SMARTCARD_VENDOR_VERIFY_PIN, ..)


Index: ifdhandler.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/ifdhandler.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- ifdhandler.c	24 May 2004 12:58:43 -0000	1.31
+++ ifdhandler.c	25 May 2004 14:46:02 -0000	1.32
@@ -274,6 +274,14 @@
 			}
 			break;
 
+		case IOCTL_SMARTCARD_VENDOR_VERIFY_PIN:
+			if (*Length >= 1)
+			{
+				*Length = 1;
+				*Value = get_ccid_descriptor(Lun) -> bPINSupport & CCID_CLASS_PIN_VERIFY;
+			}
+			break;
+
 		default:
 			return IFD_ERROR_TAG;
 	}

Index: ccid_usb.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- ccid_usb.c	25 May 2004 08:23:20 -0000	1.25
+++ ccid_usb.c	25 May 2004 14:46:02 -0000	1.26
@@ -342,6 +342,7 @@
 						(dev->descriptor.idVendor << 16) +
 						dev->descriptor.idProduct;
 					usbDevice[reader].ccid.dwFeatures = dw2i(usb_interface->altsetting->extra, 40);
+					usbDevice[reader].ccid.bPINSupport = usb_interface->altsetting->extra[52];
 					usbDevice[reader].ccid.dwMaxCCIDMessageLength = dw2i(usb_interface->altsetting->extra, 44);
 					usbDevice[reader].ccid.dwMaxIFSD = dw2i(usb_interface->altsetting->extra, 28);
 					usbDevice[reader].ccid.dwDefaultClock = dw2i(usb_interface->altsetting->extra, 10);

Index: ccid_serial.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/ccid_serial.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ccid_serial.c	24 May 2004 12:58:43 -0000	1.11
+++ ccid_serial.c	25 May 2004 14:46:02 -0000	1.12
@@ -540,6 +540,7 @@
 	serialDevice[reader].ccid.dwMaxCCIDMessageLength = 271;
 	serialDevice[reader].ccid.dwMaxIFSD = 254;
 	serialDevice[reader].ccid.dwFeatures = 0x00010230;
+	serialDevice[reader].ccid.bPINSupport = 0x0;
 	serialDevice[reader].ccid.dwDefaultClock = 4000;
 	serialDevice[reader].ccid.dwMaxDataRate = 344086;
 

Index: ccid.h
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/ccid.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ccid.h	12 Feb 2004 16:08:45 -0000	1.5
+++ ccid.h	25 May 2004 14:46:02 -0000	1.6
@@ -44,11 +44,16 @@
 	int dwMaxIFSD;
 
 	/*
-	 * Features supported by the reader (directly from class Descriptor)
+	 * Features supported by the reader (directly from Class Descriptor)
 	 */
 	int dwFeatures;
 
 	/*
+	 * PIN support of the reader (directly from Class Descriptor)
+	 */
+	char bPINSupport;
+
+	/*
 	 * Default Clock
 	 */
 	int dwDefaultClock;
@@ -60,6 +65,7 @@
 
 } _ccid_descriptor;
 
+/* Features from dwFeatures */
 #define CCID_CLASS_AUTO_CONF_ATR	0x00000002
 #define CCID_CLASS_AUTO_VOLTAGE		0x00000008
 #define CCID_CLASS_AUTO_BAUD		0x00000020
@@ -69,6 +75,10 @@
 #define CCID_CLASS_SHORT_APDU		0x00020000
 #define CCID_CLASS_EXTENDED_APDU	0x00040000
 #define CCID_CLASS_EXCHANGE_MASK	0x00070000
+
+/* Features from bPINSupport */
+#define CCID_CLASS_PIN_VERIFY		0x01
+#define CCID_CLASS_PIN_MODIFY		0x02
 
 /* See CCID specs ch. 4.2.1 */
 #define CCID_COMMAND_FAILED			0x40	/* 01 0000 00 */