Hi Ludovic,

On Wed, Sep 01, 2010 at 04:51:55PM +0200, Ludovic Rousseau wrote:
> 2010/9/1 Forest Bond <[email protected]>:
> > On Tue, Aug 31, 2010 at 09:25:12PM +0200, Ludovic Rousseau wrote:
> >> 2010/8/31 Forest Bond <[email protected]>:
> 
> >> > I have contacted Precise Biometrics and they have said that their reader 
> >> > has no
> >> > problems with the T=1 protocol and that it passes the PC/SC test suites 
> >> > v1.0 and
> >> > v2.0.
> >> >
> >> > Any ideas where the problem might be?
> >>
> >> Precise 200 MC firmware was bogus [2]. Maybe you have an "old" reader
> >> with a bogus firmware. But the bug I reported was not the same as
> >> yours.
> 
> Precise is lying to you about T=1 problems.
> 
> Here is a diff between the USB descriptor of your device and the latest one.
> 
> --- /Users/rousseau/Downloads/output.txt      2010-09-01 16:42:31.000000000 
> +0200
> +++ Precise_200_MC.txt        2009-12-03 18:20:34.000000000 +0100
> @@ -2,7 +2,7 @@
>    iManufacturer: Precise Biometrics
>   idProduct: 0x0402
>    iProduct: Precise 200 MC
> - bcdDevice: 4A.95 (firmware release?)
> + bcdDevice: 50.00 (firmware release?)
>   bLength: 9
>   bDescriptorType: 4
>   bInterfaceNumber: 0
> @@ -37,14 +37,15 @@
>    dwSynchProtocols: 0x00000000
>    dwMechanical: 0x00000000
>     No special characteristics
> -  dwFeatures: 0x000400BA
> +  dwFeatures: 0x000404BA
>     ....02 Automatic parameter configuration based on ATR data
>     ....08 Automatic ICC voltage selection
>     ....10 Automatic ICC clock frequency change according to parameters
>     ....20 Automatic baud rate change according to frequency and Fi, Di params
>     ....80 Automatic PPS made by the CCID
> +   ..04.. Automatic IFSD exchange as first exchange (T=1)
>     04.... Short and Extended APDU level exchange
> -  dwMaxCCIDMessageLength: 524288 bytes
> +  dwMaxCCIDMessageLength: 65550 bytes
>    bClassGetResponse: 0x00
>    bClassEnveloppe: 0x00
>    wLcdLayout: 0x0000
> 
> Note the new line in the dwFeatures parsing:
> +   ..04.. Automatic IFSD exchange as first exchange (T=1)
> 
> It is exactly linked to T=1 and  should be the source of your problem.
> 
> The bug has been corrected in later readers so they are aware of the problem.
> Maybe you should request for a reader exchange.
> 
> If you use a recent enough CCID driver the driver will refuse to work
> with your reader because of the bogus firmware. It would then be
> obvious the problem is on the reader side.

I upgraded the firmware using a Windows utility provided by Precise Biometrics.
According to the utility, the old firmware version is 09050510 and the new
firmware version is 10072610.

Unfortunately, I'm still unable to read my PIV card.  The logs look different
this time, though:

--------------------------------------------------------------------------------
debuglog.c:224:DebugLogSetLevel() debug level=debug
debuglog.c:253:DebugLogSetCategory() Debug options: APDU
pcscdaemon.c:505:main() pcsc-lite 1.5.3 daemon ready.
hotplug_libusb.c:477:HPAddHotPluggable() Adding USB device: 005:076
readerfactory.c:1024:RFInitializeReader() Attempting startup of Precise 200 MC 
(0016787745) 00 00 using 
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
readerfactory.c:877:RFBindFunctions() Loading IFD Handler 3.0
ifdhandler.c:1532:init_driver() Driver version: 1.3.11
ifdhandler.c:1545:init_driver() LogLevel: 0x0003
ifdhandler.c:1555:init_driver() LogLevel from LIBCCID_ifdLogLevel: 0x0007
ifdhandler.c:1565:init_driver() DriverOptions: 0x0000
ifdhandler.c:82:IFDHCreateChannelByName() lun: 0, device: 
usb:08c3/0402:libusb:005:076
ccid_usb.c:162:OpenUSBByName() Reader index: 0, Device: 
usb:08c3/0402:libusb:005:076
ccid_usb.c:285:OpenUSBByName() Manufacturer: Ludovic Rousseau 
([email protected])
ccid_usb.c:295:OpenUSBByName() ProductString: Generic CCID driver
ccid_usb.c:301:OpenUSBByName() Copyright: This driver is protected by terms of 
the GNU Lesser General Public License version 2.1, or (at your option) any 
later version.
ccid_usb.c:383:OpenUSBByName() Checking device: 005/076
ccid_usb.c:437:OpenUSBByName() Trying to open USB bus/device: 005/076
ccid_usb.c:501:OpenUSBByName() Found Vendor/Product: 08C3/0402 (Precise 200 MC)
ccid_usb.c:503:OpenUSBByName() Using USB bus/device: 005/076
ccid_usb.c:949:ControlUSB() request: 0x03
receive:
ccid_usb.c:893:get_data_rates() IFD does not support GET_DATA_RATES request: 
Broken pipe
ifdhandler.c:364:IFDHGetCapabilities() tag: 0xFB0, usb:08c3/0402:libusb:005:076 
(lun: 0)
readerfactory.c:249:RFAddReader() Using the pcscd polling thread
ifdhandler.c:364:IFDHGetCapabilities() tag: 0xFAE, usb:08c3/0402:libusb:005:076 
(lun: 0)
ifdhandler.c:418:IFDHGetCapabilities() Reader supports 1 slot(s)
hotplug_libusb.c:403:HPEstablishUSBNotifications() Driver ifd-ccid.bundle does 
not support IFD_GENERATE_HOTPLUG. Using active polling instead.
hotplug_libusb.c:412:HPEstablishUSBNotifications() Polling forced every 1 
second(s)
ifdhandler.c:1043:IFDHPowerICC() action: PowerUp, usb:08c3/0402:libusb:005:076 
(lun: 0)
-> 000000 62 00 00 00 00 00 04 00 00 00
<- 000000 80 16 00 00 00 00 04 00 00 00 3B DB 96 00 81 B1 FE 45 1F 03 80 F9 A0 
00 00 03 08 00 00 10 00 18
Card ATR: 3B DB 96 00 81 B1 FE 45 1F 03 80 F9 A0 00 00 03 08 00 00 10 00 18
winscard_msg_srv.c:239:SHMProcessEventsServer() Common channel packet arrival
winscard_msg_srv.c:248:SHMProcessEventsServer() SHMProcessCommonChannelRequest 
detects: 6
pcscdaemon.c:147:SVCServiceRunLoop() A new context thread creation is 
requested: 6
winscard_svc.c:133:ContextThread() Thread is started: 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command CMD_VERSION received 
by client 6
winscard_svc.c:189:ContextThread() Client is protocol version 3:0
winscard_msg_srv.c:317:SHMProcessEventsContext() command ESTABLISH_CONTEXT 
received by client 6
winscard.c:242:SCardEstablishContext() Establishing Context: 16986613
winscard_msg_srv.c:317:SHMProcessEventsContext() command RELEASE_CONTEXT 
received by client 6
winscard.c:253:SCardReleaseContext() Releasing Context: 16986613
winscard_msg_srv.c:306:SHMProcessEventsContext() Client has disappeared: 6
winscard_svc.c:146:ContextThread() Client die: 6
winscard_msg_srv.c:239:SHMProcessEventsServer() Common channel packet arrival
winscard_msg_srv.c:248:SHMProcessEventsServer() SHMProcessCommonChannelRequest 
detects: 6
pcscdaemon.c:147:SVCServiceRunLoop() A new context thread creation is 
requested: 6
winscard_svc.c:133:ContextThread() Thread is started: 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command CMD_VERSION received 
by client 6
winscard_svc.c:189:ContextThread() Client is protocol version 3:0
winscard_msg_srv.c:317:SHMProcessEventsContext() command ESTABLISH_CONTEXT 
received by client 6
winscard.c:242:SCardEstablishContext() Establishing Context: 16981682
winscard_msg_srv.c:317:SHMProcessEventsContext() command CONNECT received by 
client 6
winscard.c:303:SCardConnect() Attempting Connect to Precise 200 MC (0016787745) 
00 00 using protocol: 3
prothandler.c:128:PHSetProtocol() Attempting PTS to T=1
ifdhandler.c:581:IFDHSetProtocolParameters() protocol T=1, 
usb:08c3/0402:libusb:005:076 (lun: 0)
ifdhandler.c:1660:extra_egt() Extra EGT patch applied
ifdhandler.c:858:IFDHSetProtocolParameters() BWI/CWI (TB3) present: 0x45
ifdhandler.c:894:IFDHSetProtocolParameters() IFSC (TA3) present: 254
ifdhandler.c:901:IFDHSetProtocolParameters() Timeout: 2 seconds
commands.c:2015:SetParameters() length: 7 bytes
-> 000000 61 07 00 00 00 00 20 01 00 00 11 10 02 45 00 FE 00
<- 000000 83 07 00 00 00 00 20 00 00 01 11 10 02 45 00 FE 00
ifdhandler.c:961:IFDHSetProtocolParameters() IFSC (TA3) present: 254
ifdhandler.c:978:IFDHSetProtocolParameters() T=1: IFSC=254, IFSD=254
winscard.c:449:SCardConnect() Active Protocol: T=1
winscard.c:459:SCardConnect() hCard Identity: 1eadb
winscard_msg_srv.c:317:SHMProcessEventsContext() command STATUS received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command BEGIN_TRANSACTION 
received by client 6
winscard.c:1057:SCardBeginTransaction() Status: 0x00000000
winscard_msg_srv.c:317:SHMProcessEventsContext() command END_TRANSACTION 
received by client 6
winscard.c:1208:SCardEndTransaction() Status: 0x00000000
winscard_msg_srv.c:317:SHMProcessEventsContext() command BEGIN_TRANSACTION 
received by client 6
winscard.c:1057:SCardBeginTransaction() Status: 0x00000000
winscard_msg_srv.c:317:SHMProcessEventsContext() command STATUS received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard.c:1647:SCardTransmit() Send Protocol: T=1
APDU: 00 A4 04 0C 0C E8 28 BD 08 0F D2 50 00 00 04 03 01
ifdhandler.c:1170:IFDHTransmitToICC() usb:08c3/0402:libusb:005:076 (lun: 0)
commands.c:1395:CmdXfrBlockAPDU_extended() T=0 (extended): 17 bytes
-> 000000 6F 11 00 00 00 00 21 00 00 00 00 A4 04 0C 0C E8 28 BD 08 0F D2 50 00 
00 04 03 01
<- 000000 80 00 00 00 00 00 21 40 FB 00
commands.c:1301:CCID_Receive Hardware error
SW:
ifdwrapper.c:722:IFDTransmit() Card not transacted: 612
winscard.c:1671:SCardTransmit() Card not transacted: 0x80100016
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard.c:1647:SCardTransmit() Send Protocol: T=1
APDU: 00 A4 04 00 07 A0 00 00 00 03 00 00
ifdhandler.c:1170:IFDHTransmitToICC() usb:08c3/0402:libusb:005:076 (lun: 0)
commands.c:1395:CmdXfrBlockAPDU_extended() T=0 (extended): 12 bytes
-> 000000 6F 0C 00 00 00 00 23 00 00 00 00 A4 04 00 07 A0 00 00 00 03 00 00
ccid_usb.c:634:ReadUSB() usb_bulk_read(005/076): Resource temporarily 
unavailable
SW:
ifdwrapper.c:722:IFDTransmit() Card not transacted: 612
winscard.c:1671:SCardTransmit() Card not transacted: 0x80100016
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard.c:1647:SCardTransmit() Send Protocol: T=1
APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
ccid_usb.c:656:ReadUSB() Duplicate frame detected
ccid_usb.c:634:ReadUSB() usb_bulk_read(005/076): Resource temporarily 
unavailable
ifdhandler.c:1170:IFDHTransmitToICC() usb:08c3/0402:libusb:005:076 (lun: 0)
commands.c:1395:CmdXfrBlockAPDU_extended() T=0 (extended): 13 bytes
-> 000000 6F 0D 00 00 00 00 25 00 00 00 00 A4 04 00 08 A0 00 00 00 03 00 00 00
ifdwrapper.c:469:IFDStatusICC() Card not transacted: 612
eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Precise 200 
MC (0016787745) 00 00
ccid_usb.c:634:ReadUSB() usb_bulk_read(005/076): Resource temporarily 
unavailable
SW:
ifdwrapper.c:722:IFDTransmit() Card not transacted: 612
winscard.c:1671:SCardTransmit() Card not transacted: 0x80100016
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command TRANSMIT received by 
client 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command END_TRANSACTION 
received by client 6
winscard.c:1208:SCardEndTransaction() Status: 0x00000000
winscard_msg_srv.c:317:SHMProcessEventsContext() command DISCONNECT received by 
client 6
winscard.c:880:SCardDisconnect() Active Contexts: -1
winscard_msg_srv.c:317:SHMProcessEventsContext() command RELEASE_CONTEXT 
received by client 6
winscard.c:253:SCardReleaseContext() Releasing Context: 16981682
winscard_msg_srv.c:306:SHMProcessEventsContext() Client has disappeared: 6
winscard_svc.c:146:ContextThread() Client die: 6
ccid_usb.c:634:ReadUSB() usb_bulk_read(005/076): Resource temporarily 
unavailable
ifdwrapper.c:469:IFDStatusICC() Card not transacted: 612
eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Precise 200 
MC (0016787745) 00 00
ccid_usb.c:596:WriteUSB() usb_bulk_write(005/076): Resource temporarily 
unavailable
ifdwrapper.c:469:IFDStatusICC() Card not transacted: 612
eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Precise 200 
MC (0016787745) 00 00
winscard_msg_srv.c:239:SHMProcessEventsServer() Common channel packet arrival
winscard_msg_srv.c:248:SHMProcessEventsServer() SHMProcessCommonChannelRequest 
detects: 6
pcscdaemon.c:147:SVCServiceRunLoop() A new context thread creation is 
requested: 6
winscard_svc.c:133:ContextThread() Thread is started: 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command CMD_VERSION received 
by client 6
winscard_svc.c:189:ContextThread() Client is protocol version 3:0
winscard_msg_srv.c:317:SHMProcessEventsContext() command ESTABLISH_CONTEXT 
received by client 6
winscard.c:242:SCardEstablishContext() Establishing Context: 16977814
winscard_msg_srv.c:317:SHMProcessEventsContext() command RELEASE_CONTEXT 
received by client 6
winscard.c:253:SCardReleaseContext() Releasing Context: 16977814
winscard_msg_srv.c:306:SHMProcessEventsContext() Client has disappeared: 6
winscard_svc.c:146:ContextThread() Client die: 6
winscard_msg_srv.c:239:SHMProcessEventsServer() Common channel packet arrival
winscard_msg_srv.c:248:SHMProcessEventsServer() SHMProcessCommonChannelRequest 
detects: 6
pcscdaemon.c:147:SVCServiceRunLoop() A new context thread creation is 
requested: 6
winscard_svc.c:133:ContextThread() Thread is started: 6
winscard_msg_srv.c:317:SHMProcessEventsContext() command CMD_VERSION received 
by client 6
winscard_svc.c:189:ContextThread() Client is protocol version 3:0
winscard_msg_srv.c:317:SHMProcessEventsContext() command ESTABLISH_CONTEXT 
received by client 6
winscard.c:242:SCardEstablishContext() Establishing Context: 17021772
winscard_msg_srv.c:317:SHMProcessEventsContext() command CONNECT received by 
client 6
winscard.c:303:SCardConnect() Attempting Connect to Precise 200 MC (0016787745) 
00 00 using protocol: 3
winscard_msg_srv.c:317:SHMProcessEventsContext() command RELEASE_CONTEXT 
received by client 6
winscard.c:253:SCardReleaseContext() Releasing Context: 17021772
winscard_msg_srv.c:306:SHMProcessEventsContext() Client has disappeared: 6
winscard_svc.c:146:ContextThread() Client die: 6
ccid_usb.c:596:WriteUSB() usb_bulk_write(005/076): Resource temporarily 
unavailable
ifdwrapper.c:469:IFDStatusICC() Card not transacted: 612
eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Precise 200 
MC (0016787745) 00 00
^Cpcscdaemon.c:580:signal_trap() Preparing for suicide
hotplug_libusb.c:377:HPRescanUsbBus() Hotplug stopped
readerfactory.c:1267:RFCleanupReaders() entering cleaning function
readerfactory.c:1276:RFCleanupReaders() Stopping reader: Precise 200 MC 
(0016787745) 00 00
eventhandler.c:126:EHDestroyEventHandler() Stomping thread.
ccid_usb.c:596:WriteUSB() usb_bulk_write(005/076): Resource temporarily 
unavailable
ifdhandler.c:364:IFDHGetCapabilities() tag: 0xFB1, usb:08c3/0402:libusb:005:076 
(lun: 0)
eventhandler.c:139:EHDestroyEventHandler() Waiting polling thread
ifdwrapper.c:469:IFDStatusICC() Card not transacted: 612
eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Precise 200 
MC (0016787745) 00 00
eventhandler.c:474:EHStatusHandlerThread() Die
eventhandler.c:163:EHDestroyEventHandler() Thread stomped.
readerfactory.c:1062:RFUnInitializeReader() Attempting shutdown of Precise 200 
MC (0016787745) 00 00.
ifdhandler.c:266:IFDHCloseChannel() usb:08c3/0402:libusb:005:076 (lun: 0)
-> 000000 63 00 00 00 00 00 2A 00 00 00
ccid_usb.c:596:WriteUSB() usb_bulk_write(005/076): Resource temporarily 
unavailable
ccid_usb.c:677:CloseUSB() Closing USB device: 005/076
ccid_usb.c:692:CloseUSB() Last slot closed. Release resources
readerfactory.c:914:RFUnloadReader() Unloading reader driver.
pcscdaemon.c:530:at_exit() cleaning /var/run/pcscd
--------------------------------------------------------------------------------

Here's the output from ccid's parse utility (note the firmware version reported
here is greater than 50.00):

--------------------------------------------------------------------------------
 idVendor: 0x08C3
  iManufacturer: Precise Biometrics
 idProduct: 0x0402
  iProduct: Precise 200 MC
 bcdDevice: 52.57 (firmware release?)
 bLength: 9
 bDescriptorType: 4
 bInterfaceNumber: 0
 bAlternateSetting: 0
 bNumEndpoints: 3
  bulk-IN, bulk-OUT and Interrupt-IN
 bInterfaceClass: 0x0B [Chip Card Interface Device Class (CCID)]
 bInterfaceSubClass: 0
 bInterfaceProtocol: 0
  bulk transfer, optional interrupt-IN (CCID)
 iInterface: ?
 CCID Class Descriptor
  bLength: 0x36
  bDescriptorType: 0x21
  bcdCCID: 1.00
  bMaxSlotIndex: 0x00
  bVoltageSupport: 0x03
   5.0V
   3.0V
  dwProtocols: 0x0000 0x0003
   T=0
   T=1
  dwDefaultClock: 4.000 MHz
  dwMaximumClock: 7.500 MHz
  bNumClockSupported: 0 (will use whatever is returned)
   IFD does not support GET CLOCK FREQUENCIES request: Broken pipe
  dwDataRate: 10753 bps
  dwMaxDataRate: 241936 bps
  bNumDataRatesSupported: 0 (will use whatever is returned)
   IFD does not support GET_DATA_RATES request: Broken pipe
  dwMaxIFSD: 254
  dwSynchProtocols: 0x00000000
  dwMechanical: 0x00000000
   No special characteristics
  dwFeatures: 0x000404BA
   ....02 Automatic parameter configuration based on ATR data
   ....08 Automatic ICC voltage selection
   ....10 Automatic ICC clock frequency change according to parameters
   ....20 Automatic baud rate change according to frequency and Fi, Di params
   ....80 Automatic PPS made by the CCID
   ..04.. Automatic IFSD exchange as first exchange (T=1)
   04.... Short and Extended APDU level exchange
  dwMaxCCIDMessageLength: 65550 bytes
  bClassGetResponse: 0x00
  bClassEnveloppe: 0x00
  wLcdLayout: 0x0000
  bPINSupport: 0x00
  bMaxCCIDBusySlots: 1
--------------------------------------------------------------------------------

Thoughts?

Thanks,
Forest
-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to