Extended length APDU solved for Cardman

Werner Koch wk at gnupg.org
Tue Jun 30 09:33:23 CEST 2009

Hi Ludovic,

After spending too much time trying to trace the USB commands of the
Cardman readers using Windows under KVM I switched back to the old
sniffusb tool on native Windows.

I figured out how to send extended APDUs and it works now with GnuPG's
internal driver and the new OpenPGP card.  I have not yet tested other
cards.  Tested with a CM6121 and the CM4040 PCCARD reader.  I still need
to check wether the Cherry keyboard works the same way and maybe even
try the KAAN reader.

You need to switch to TPDU mode for extended length APDUs.  They are
send using the CCID Escape sequence 00 00 00 1A followed by the TPDU.
The response is a 1A followed by the TPDU.  The only problem is that you
need to resync the T=1 sequence counter if the reader returns an error
(which is likely).  Make sure to use a NAD of 0x00.

If you want to trace stuff yourself
might be useful.  Should build as a standalone program; usage is

  ccidmod --sniffusb <logfile.usb



Die Gedanken sind frei.  Auschnahme regelt ein Bundeschgesetz.

More information about the Gnupg-devel mailing list