Hello,

--- Jim Rees <[EMAIL PROTECTED]> wrote:
>   > - How do I find out about the length of an ATR ?
> The towitoko driver
>   By parsing it.
> 
> This is a less than satisfactory solution.  It works
> if the card strictly
> complies with 7816, but it's nice to know if the
> card has returned too many
> or too few bytes, as some do.
>

Towitoko Ct-api driver *does* return actual size of
the ATR. Also it permits retrieve the full ATR,
historical bytes of the ATR, or just card 
card reset status, as described in CT-BCS
specification, sending appropriate CT-BCS commands.

The IFD_Handler is the part of the resource manager
that introduces 0x00 padding bytes and returns Atr
length = MAX_ATR_SIZE. This is the part of
IFD_Handler.c that returns the ATR:

  // ...
  } else if ( HighNibble == 0x03 ) {      /* This is
the ICC_STATE */

    switch( LowNibble ) {

      // ...
   
      case 0x03:
        memcpy(Value, ICC.ATR, MAX_ATR_SIZE);
        lRetVal = IFD_SUCCESS;  
        break;

      // ...

Maybe this should be corrected, so it returns ATR
length as it's given by ct-api driver. But it has to
be done for all reader drivers (I think IFD Handler is
the same for all readers). Not only for Towitoko
driver.

>   I have a T=1 protocol driver in my own library.
> About 600 lines.
>   You could try to include it in MUSCLE.
> 
> Is this for the Towitoko reader, or would it have to
> be modified to work
> with Carlos's driver?  I would very much like to see
> T=1 for Towitoko.
>

T=1 protocol is far from being trivial to implement if
the reader hardware does not implement communication
protocol with the card, as happens with Towitoko's.
Maybe we should have a common GPL implementation of
T=1, using generic I/O routines to comunicate with the
card, so that it could be reused for every driver of
the MUSCLE. 

Thanks,
Carlos.

_____________________________________________________________
Do You Yahoo!?
Free instant messaging and more at http://messenger.yahoo.com

***************************************************************
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***************************************************************

Reply via email to