changed vendorid/productid, added new structures for future PIN support.

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@11 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2010-01-05 18:44:22 +00:00
parent a29dc882ea
commit a4ec33c83e
2 changed files with 52 additions and 12 deletions

View File

@@ -46,9 +46,9 @@
#include "ccid.h"
#define DRIVER_VENDOR_NUM 0x08E6 /* FIXME */
#define DRIVER_ISO_PRODUCT_NUM 0x8000 /* FIXME */
#define DRIVER_PRODUCT_NUM 0x8000 /* FIXME */
#define DRIVER_VENDOR_NUM 0x0D46 /* KOBIL Systems */
#define DRIVER_ISO_PRODUCT_NUM 0x3010 /* KOBIL Class 3 Reader */
#define DRIVER_PRODUCT_NUM 0x3010 /* KOBIL Class 3 Reader */
static int vendorid = DRIVER_VENDOR_NUM;
static int productid = DRIVER_PRODUCT_NUM;
static int verbose = 0;
@@ -239,7 +239,8 @@ static const struct usb_endpoint_descriptor *hs_eps [] = {
/*-------------------------------------------------------------------------*/
static char serial [64];
/* 56 is the maximum for the KOBIL Class 3 Reader */
static char serial [57];
static struct usb_string stringtab [] = {
{ STRINGID_MFGR, "morgner@informatik.hu-berlin.de", },
@@ -1706,11 +1707,11 @@ main (int argc, char **argv)
}
continue;
}
if (sscanf(argv[i], "--serial=%64s", serial) == 1) continue;
if (sscanf(argv[i], "--serial=%56s", serial) == 1) continue;
if (strcmp(argv[i], "-s") == 0) {
i++;
if (sscanf(argv[i], "%64s", serial) != 1) {
fprintf(stderr, "string (max 63 bytes) expected: \"%s\"\n", argv[i]);
if (sscanf(argv[i], "%56s", serial) != 1) {
fprintf(stderr, "string (max 56 bytes) expected: \"%s\"\n", argv[i]);
return 1;
}
continue;

View File

@@ -68,6 +68,21 @@ typedef struct {
__u8 bNadValue;
} __attribute__ ((packed)) abProtocolDataStructure_T1_t;
typedef struct {
__u8 bPINOperation;
__u8 bTimeOut;
__u8 bmFormatString;
__u8 bmPINBlockString;
__u8 bmPINLengthFormat;
__le16 wPINMaxExtraDigit;
__u8 bEntryValidationCondition;
__u8 bNumberMessage;
__le16 wLangId;
__u8 bMsgIndex;
__u8 bTeoPrologue1;
__le16 bTeoPrologue2;
} __attribute__ ((packed)) abPINOperationDataStucture
typedef struct {
__u8 bMessageType;
__le32 dwLength;
@@ -116,6 +131,14 @@ typedef struct {
__u8 bProtocolNum;
__le16 abRFU;
} __attribute__ ((packed)) PC_to_RDR_SetParameters_t;
typedef struct {
__u8 bMessageType;
__le32 dwLength;
__u8 bSlot;
__u8 bSeq;
__u8 bBWI;
__le16 wLevelParameter;
} __attribute__ ((packed)) PC_to_RDR_Secure_t;
typedef struct {
__u8 bMessageType;
__le32 dwLength;
@@ -185,8 +208,8 @@ ccid_desc = {
.dwMaxIFSD = __constant_cpu_to_le32(0xFF), // FIXME
.dwSynchProtocols = __constant_cpu_to_le32(0),
.dwMechanical = __constant_cpu_to_le32(0),
.dwFeatures = __constant_cpu_to_le32(0x2|
// Automatic parameter configuration based on ATR data
.dwFeatures = __constant_cpu_to_le32(
0x2| // Automatic parameter configuration based on ATR data
0x8| // Automatic ICC voltage selection
0x10| // Automatic ICC clock frequency change
0x20| // Automatic baud rate change
@@ -197,9 +220,14 @@ ccid_desc = {
.dwMaxCCIDMessageLength = __constant_cpu_to_le32(261+10),
.bClassGetResponse = 0xFF,
.bclassEnvelope = 0xFF,
.wLcdLayout = __constant_cpu_to_le16(0),
.bPINSupport = 0,
.bMaxCCIDBusySlots = 1,
.wLcdLayout = __constant_cpu_to_le16(
0),
//0xFF00| // Number of lines for the LCD display
//0x00FF), // Number of characters per line
.bPINSupport = 0, // PIN Modification supported
//.bPINSupport = 0x1| // PIN Verification supported
//0x2, // PIN Modification supported
.bMaxCCIDBusySlots = 0x01,
};
@@ -593,6 +621,17 @@ perform_PC_to_RDR_GetParamters(const PC_to_RDR_GetParameters_t request,
pcsc_result, abProtocolDataStructure);
}
//RDR_to_PC_Parameters_t
//perform_PC_to_RDR_Secure(const PC_to_RDR_Secure_t request,
//__u8* abData)
//{
//if ( request.bMessageType != 0x69 ||
//request.bSlot != 0 ||
//request.wLevelParameter != __constant_cpu_to_le16(0))
//fprintf(stderr, "warning: malformed PC_to_RDR_Secure\n");
//}
RDR_to_PC_NotifySlotChange_t
get_RDR_to_PC_NotifySlotChange ()
{