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:
15
ccid/ccid.c
15
ccid/ccid.c
@@ -46,9 +46,9 @@
|
|||||||
#include "ccid.h"
|
#include "ccid.h"
|
||||||
|
|
||||||
|
|
||||||
#define DRIVER_VENDOR_NUM 0x08E6 /* FIXME */
|
#define DRIVER_VENDOR_NUM 0x0D46 /* KOBIL Systems */
|
||||||
#define DRIVER_ISO_PRODUCT_NUM 0x8000 /* FIXME */
|
#define DRIVER_ISO_PRODUCT_NUM 0x3010 /* KOBIL Class 3 Reader */
|
||||||
#define DRIVER_PRODUCT_NUM 0x8000 /* FIXME */
|
#define DRIVER_PRODUCT_NUM 0x3010 /* KOBIL Class 3 Reader */
|
||||||
static int vendorid = DRIVER_VENDOR_NUM;
|
static int vendorid = DRIVER_VENDOR_NUM;
|
||||||
static int productid = DRIVER_PRODUCT_NUM;
|
static int productid = DRIVER_PRODUCT_NUM;
|
||||||
static int verbose = 0;
|
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 [] = {
|
static struct usb_string stringtab [] = {
|
||||||
{ STRINGID_MFGR, "morgner@informatik.hu-berlin.de", },
|
{ STRINGID_MFGR, "morgner@informatik.hu-berlin.de", },
|
||||||
@@ -1706,11 +1707,11 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
continue;
|
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) {
|
if (strcmp(argv[i], "-s") == 0) {
|
||||||
i++;
|
i++;
|
||||||
if (sscanf(argv[i], "%64s", serial) != 1) {
|
if (sscanf(argv[i], "%56s", serial) != 1) {
|
||||||
fprintf(stderr, "string (max 63 bytes) expected: \"%s\"\n", argv[i]);
|
fprintf(stderr, "string (max 56 bytes) expected: \"%s\"\n", argv[i]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
49
ccid/ccid.h
49
ccid/ccid.h
@@ -68,6 +68,21 @@ typedef struct {
|
|||||||
__u8 bNadValue;
|
__u8 bNadValue;
|
||||||
} __attribute__ ((packed)) abProtocolDataStructure_T1_t;
|
} __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 {
|
typedef struct {
|
||||||
__u8 bMessageType;
|
__u8 bMessageType;
|
||||||
__le32 dwLength;
|
__le32 dwLength;
|
||||||
@@ -116,6 +131,14 @@ typedef struct {
|
|||||||
__u8 bProtocolNum;
|
__u8 bProtocolNum;
|
||||||
__le16 abRFU;
|
__le16 abRFU;
|
||||||
} __attribute__ ((packed)) PC_to_RDR_SetParameters_t;
|
} __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 {
|
typedef struct {
|
||||||
__u8 bMessageType;
|
__u8 bMessageType;
|
||||||
__le32 dwLength;
|
__le32 dwLength;
|
||||||
@@ -185,8 +208,8 @@ ccid_desc = {
|
|||||||
.dwMaxIFSD = __constant_cpu_to_le32(0xFF), // FIXME
|
.dwMaxIFSD = __constant_cpu_to_le32(0xFF), // FIXME
|
||||||
.dwSynchProtocols = __constant_cpu_to_le32(0),
|
.dwSynchProtocols = __constant_cpu_to_le32(0),
|
||||||
.dwMechanical = __constant_cpu_to_le32(0),
|
.dwMechanical = __constant_cpu_to_le32(0),
|
||||||
.dwFeatures = __constant_cpu_to_le32(0x2|
|
.dwFeatures = __constant_cpu_to_le32(
|
||||||
// Automatic parameter configuration based on ATR data
|
0x2| // Automatic parameter configuration based on ATR data
|
||||||
0x8| // Automatic ICC voltage selection
|
0x8| // Automatic ICC voltage selection
|
||||||
0x10| // Automatic ICC clock frequency change
|
0x10| // Automatic ICC clock frequency change
|
||||||
0x20| // Automatic baud rate change
|
0x20| // Automatic baud rate change
|
||||||
@@ -197,9 +220,14 @@ ccid_desc = {
|
|||||||
.dwMaxCCIDMessageLength = __constant_cpu_to_le32(261+10),
|
.dwMaxCCIDMessageLength = __constant_cpu_to_le32(261+10),
|
||||||
.bClassGetResponse = 0xFF,
|
.bClassGetResponse = 0xFF,
|
||||||
.bclassEnvelope = 0xFF,
|
.bclassEnvelope = 0xFF,
|
||||||
.wLcdLayout = __constant_cpu_to_le16(0),
|
.wLcdLayout = __constant_cpu_to_le16(
|
||||||
.bPINSupport = 0,
|
0),
|
||||||
.bMaxCCIDBusySlots = 1,
|
//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);
|
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
|
RDR_to_PC_NotifySlotChange_t
|
||||||
get_RDR_to_PC_NotifySlotChange ()
|
get_RDR_to_PC_NotifySlotChange ()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user