On Mon, 2012-02-27 at 20:54 +0100, Andreas Kroehnert wrote:
> Hi Anthony,
> 
> ( To mess it up even more SafeNet now renamed/rebranded the ikey 4000
> to eToken 5000)

FWIW, SafeNet bought DataKey and the DataKey Card Operating System
(DKCOS) (which RainBow had licensed from DataKey BTW) and SafeNet
renamed DKCOS to SafeNet Cryptographic Card Operating System (SCCOS).


> Back to topic: In general its claimed that regardless of the PID, the
> ikey4000 / SC400 is a CCID compliant device, but I never got it to
> work using libccid. 

The two iKey4000 tokens I had worked with certainly are not CCID
compliant.  The USB descriptors for CCID device don't exist on them.
They also only use the USB control pipe AFAICT.


> While developing the first attempt of the patch I was confused why the
> ATR from the card contains a trailing byte before it continues with
> 0x3B... 

FWIW that extra byte is the length of the ATR and Historical bytes that
follow:

URB[14-15]
  ControlTransfer
    bRequestType: 0x41 (Write-Vendor-Interface)
    bRequest: 22          ---> 0x16 (22): command for reader (usually)
    wValue: 8197 (0x2005) ---> 0x05: Get ATR?   0x20: Fetch only 32 (0x20) bytes
    wIndex: 0 (0x0000)
    wLength: 0

URB[16-17]
struct AnswerToReset
{
        u8 length;         /* 0x19 = 25 meaningful bytes follow */
        u8 atr[9];         /* Defined in ISO std for smartcards: TS - TD */
        u8 historical[16]; /* historical bytes: Type, Key-Len Val, Key-Len Val 
and XORsum */
        u8 crud[6];
};
  ControlTransfer
    data:
     0000: 19 3b ff 18 00 00 81 31 fe 4d 80 25 a0 00 00 00 |  ;     1 M %     |
     0010: 56 57 44 4b 34 30 30 06 00 dd c8 40 02 01 a0 00 | VWDK400    @     |
    bRequestType: 0xc1 (Read-Vendor-Interface)
    bRequest: 1
    wValue: 0 (0x0000)
    wIndex: 0 (0x0000)
    wLength: 32

The "smart card" is internally a DataKey 400 (DK400).  Sending that ATR
through the online ATR parser yields the following:


Parsing ATR: 3B FF 18 00 00 81 31 FE 4D 80 25 A0 00 00 00 56 57 44 4B 34 30 30 
06 00 DD
TS = 0x3B       Direct Convention
T0 = 0xFF       Y(1): b1111, K: 15 (historical bytes)
TA(1) = 0x18    Fi=372, Di=12, 31 cycles/ETU (129032 bits/s at 4.00 MHz, 161290 
bits/s for fMax=5 MHz)
TB(1) = 0x00    VPP is not electrically connected
TC(1) = 0x00    Extra guard time: 0
TD(1) = 0x81    Y(i+1) = b1000, Protocol T=1
----
TD(2) = 0x31    Y(i+1) = b0011, Protocol T=1
----
TA(3) = 0xFE    IFSC: 254
TB(3) = 0x4D    Block Waiting Integer: 4 - Character Waiting Integer: 13
----
Historical bytes        80 25 A0 00 00 00 56 57 44 4B 34 30 30 06 00
Category indicator byte: 0x80   
 (compact TLV data object)
    Tag: 2, Len: 5 (issuer identification number, ISO 7812-1)
      Issuer identification number: A0 00 00 00 56    Tag: 5, Len: 7 (card 
issuer's data)
      Card issuer data: 44 4B 34 30 30 06 00
TCK = 0xDD      (correct checksum)


Regards,
Andy

> Kind Regards
> Andreas


_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to