[Pcsclite-muscle] Different behaviour with Select MF on Omnikey 5427 and 5022

Stephan Guilloux stephan.guilloux at crisalid.com
Wed Nov 4 05:15:27 EST 2020


and the logs taken with a 5022, same processing.



Stéphan GUILLOUX
Ingénieur Développement Sr

40 avenue de la libération 57160 Châtel St-Germain
Tél. 03 87 65 98 80 / poste 221
stephan.guilloux at crisalid.com

LES LOGICIELS QUI VOUS DONNENT DES AILES ! - www.crisalid.com




Le mer. 4 nov. 2020 à 11:14, Stephan Guilloux
<stephan.guilloux at crisalid.com> a écrit :
>
> Here you are.
>
> I took the opportunity to update PCSC and CCID to the latest versions
> available (1.9.0 and 1.4.33).
> Results are the same.
>
> To reproduce, I ran the last official scard_example.go and rebuilt it
> with the libs above.
> scard_example output is inserted in each PCSC log file.
>
> For comparison, the same process is used with a 5427 and a 5022.
> 5427 logs are attached in this mail.
> 5022 will be sent in a second mail.
>
> Stephan.
>
>
> Le mar. 3 nov. 2020 à 18:41, Ludovic Rousseau
> <ludovic.rousseau at gmail.com> a écrit :
> >
> > Le mar. 3 nov. 2020 à 15:52, Stephan Guilloux
> > <stephan.guilloux at crisalid.com> a écrit :
> > >
> > > Spent some time to reduce the code to the strict minimum, and it comes
> > > almost the same as
> > >      https://github.com/ebfe/scard/blob/master/example_test.go
> > > (traces are a bit different though)
> > >
> > > APDU is take from the same example:
> > >      0x00, 0xa4, 0x00, 0x0c, 0x02, 0x3f, 0x00
> >
> > The next step is to generate a pcscd trace as documented in
> > https://pcsclite.apdu.fr/#support
> >
> > Bye
> >
> > --
> >  Dr. Ludovic Rousseau
> >
> > _______________________________________________
> > pcsclite-muscle mailing list
> > pcsclite-muscle at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/pcsclite-muscle
-------------- next part --------------
[root at Rasp-8AC500 ~]$ ./scard-example 
Found 1 readers:
[0] HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00
Waiting for a Card
Connecting to card in  HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00
Card status:
     reader: HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00
     state: 10034
     active protocol: 2
     atr: 3b 8f 80 01 80 4f 0c a0 00 00 03 06 03 00 01 00 00 00 00 6a
Transmit:
	c-apdu: 00 a4 00 0c 02 3f 00
	r-apdu: 6a 81
[root at Rasp-8AC500 ~]$ 

----------------------------------------------------------------------

00000000 debuglog.c:299:DebugLogSetLevel() debug level=debug
00000137 debuglog.c:320:DebugLogSetCategory() Debug options: APDU
00000025 [1996279808] pcscdaemon.c:353:main() Force colored logs
00002267 [1996279808] configfile.l:293:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00000736 [1996279808] configfile.l:330:DBGetReaderListDir() Skipping non regular file: ..
00000038 [1996279808] configfile.l:330:DBGetReaderListDir() Skipping non regular file: .
00001345 [1996279808] pcscdaemon.c:663:main() pcsc-lite 1.9.0 daemon ready.
00025703 [1982047168] hotplug_libusb.c:538:HPAddHotPluggable() Adding USB device: 1:12:0
00008360 [1982047168] readerfactory.c:1075:RFInitializeReader() Attempting startup of HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000960 [1982047168] readerfactory.c:950:RFBindFunctions() Loading IFD Handler 3.0
00000191 [1982047168] ifdhandler.c:2008:init_driver() Driver version: 1.4.33
00007610 [1982047168] ifdhandler.c:2025:init_driver() LogLevel: 0x0003
00000055 [1982047168] ifdhandler.c:2036:init_driver() DriverOptions: 0x0000
00001389 [1982047168] ifdhandler.c:2049:init_driver() LogLevel from LIBCCID_ifdLogLevel: 0x000F
00000036 [1982047168] ifdhandler.c:110:CreateChannelByNameOrChannel() Lun: 0, device: usb:076b/5022:libusb-1.0:1:12:0
00000051 [1982047168] ccid_usb.c:237:OpenUSBByName() Reader index: 0, Device: usb:076b/5022:libusb-1.0:1:12:0
00000067 [1982047168] ccid_usb.c:282:OpenUSBByName() interface_number: 0
00000026 [1982047168] ccid_usb.c:284:OpenUSBByName() usb bus/device: 1/12
00000027 [1982047168] ccid_usb.c:302:OpenUSBByName() Using: /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
00007691 [1982047168] ccid_usb.c:320:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau (ludovic.rousseau at free.fr)
00000056 [1982047168] ccid_usb.c:321:OpenUSBByName() ifdProductString: Generic CCID driver
00000029 [1982047168] ccid_usb.c:322: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.
00012070 [1982047168] ccid_usb.c:406:OpenUSBByName() Try device: 1/12
00000058 [1982047168] ccid_usb.c:416:OpenUSBByName() vid/pid : 076B/5022
00000025 [1982047168] ccid_usb.c:483:OpenUSBByName() Checking device: 1/12
00000025 [1982047168] ccid_usb.c:554:OpenUSBByName() Trying to open USB bus/device: 1/12
00000477 [1982047168] ccid_usb.c:660:OpenUSBByName() Found Vendor/Product: 076B/5022 (HID Global OMNIKEY 5022 Smart Card Reader)
00000029 [1982047168] ccid_usb.c:662:OpenUSBByName() Using USB bus/device: 1/12
00000026 [1982047168] ccid_usb.c:722:OpenUSBByName() bNumDataRatesSupported is 0
00011779 [1982047168] ccid_usb.c:1327:InterruptRead() before (0), timeout: 100 ms
00000595 [1982047168] ccid_usb.c:1373:InterruptRead() after (0) (0)
00000156 [1982047168] NotifySlotChange: 50 02 
00000130 [1982047168] -> 000000 65 00 00 00 00 00 00 00 00 00 
00000572 [1982047168] <- 000000 81 00 00 00 00 00 00 02 00 00 
00000153 [1982047168] -> 000000 65 00 00 00 00 00 01 00 00 00 
00000595 [1982047168] <- 000000 81 00 00 00 00 00 01 02 00 00 
00000150 [1982047168] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFB3, usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000122 [1982047168] readerfactory.c:396:RFAddReader() Using the reader polling thread
00000121 [1982047168] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000128 [1982047168] -> 000000 65 00 00 00 00 00 02 00 00 00 
00000606 [1982047168] <- 000000 81 00 00 00 00 00 02 02 00 00 
00000275 [1982047168] ifdhandler.c:1989:IFDHICCPresence() Card absent
00000465 [1982047168] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFAE, usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000178 [1982047168] ifdhandler.c:476:IFDHGetCapabilities() Reader supports 1 slot(s)
00000620 [1963975616] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000054 [1963975616] -> 000000 65 00 00 00 00 00 03 00 00 00 
00000827 [1982047168] hotplug_libusb.c:442:HPEstablishUSBNotifications() Driver ifd-ccid.bundle does not support IFD_GENERATE_HOTPLUG. Using active polling instead.
00000099 [1982047168] hotplug_libusb.c:451:HPEstablishUSBNotifications() Polling forced every 1 second(s)
00000097 [1996279808] readerfactory.c:1410:RFWaitForReaderInit() Waiting init for reader: HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00
00000978 [1963975616] <- 000000 81 00 00 00 00 00 03 02 00 00 
00000032 [1963975616] ifdhandler.c:1989:IFDHICCPresence() Card absent
00000030 [1963975616] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000045 [1963975616] -> 000000 65 00 00 00 00 00 04 00 00 00 
00000804 [1963975616] <- 000000 81 00 00 00 00 00 04 02 00 00 
00000029 [1963975616] ifdhandler.c:1989:IFDHICCPresence() Card absent
00000026 [1963975616] ifdhandler.c:310:IFDHPolling() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0) 600000 ms
00000022 [1963975616] ccid_usb.c:1327:InterruptRead() before (0), timeout: 600000 ms
04860568 [1996279808] winscard_msg_srv.c:256:ProcessEventsServer() Common channel packet arrival
00000108 [1996279808] winscard_msg_srv.c:268:ProcessEventsServer() ProcessCommonChannelRequest detects: 6
00000026 [1996279808] pcscdaemon.c:133:SVCServiceRunLoop() A new context thread creation is requested: 6
00000320 [1953493952] winscard_svc.c:340:ContextThread() Authorized PC/SC client
00000035 [1953493952] winscard_svc.c:344:ContextThread() Thread is started: dwClientID=6, threadContext @0x1d2e740
00000070 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_VERSION from client 6
00000051 [1953493952] winscard_svc.c:374:ContextThread() Client is protocol version 4:4
00000025 [1953493952] winscard_svc.c:396:ContextThread() CMD_VERSION rv=0x0 for client 6
00000339 [1953493952] winscard_svc.c:362:ContextThread() Received command: ESTABLISH_CONTEXT from client 6
00000059 [1953493952] winscard.c:215:SCardEstablishContext() Establishing Context: 0xF7B587E
00000035 [1953493952] winscard_svc.c:461:ContextThread() ESTABLISH_CONTEXT rv=0x0 for client 6
00000294 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 6
00000306 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 6
00000641 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 6
00000384 [1953493952] winscard_svc.c:834:MSGSendReaderStates() Send reader states: 6
00000326 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 6
00000040 [1953493952] winscard_svc.c:442:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 6
00000356 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 6
00000039 [1953493952] winscard_svc.c:834:MSGSendReaderStates() Send reader states: 6
02056549 [1963975616] ccid_usb.c:1373:InterruptRead() after (0) (0)
00000060 [1963975616] NotifySlotChange: 50 03 
00000036 [1963975616] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000040 [1963975616] -> 000000 65 00 00 00 00 00 05 00 00 00 
00000559 [1963975616] <- 000000 81 00 00 00 00 00 05 01 00 00 
00000035 [1963975616] ifdhandler.c:1989:IFDHICCPresence() Card present
00000027 [1963975616] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000075 [1963975616] -> 000000 65 00 00 00 00 00 06 00 00 00 
00000605 [1963975616] <- 000000 81 00 00 00 00 00 06 01 00 00 
00000030 [1963975616] ifdhandler.c:1989:IFDHICCPresence() Card present
00000028 [1963975616] ifdhandler.c:1167:IFDHPowerICC() action: PowerUp, usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000080 [1963975616] -> 000000 62 00 00 00 00 00 07 00 00 00 
00009310 [1963975616] <- 000000 80 14 00 00 00 00 07 00 00 00 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A 
00000074 [1963975616] eventhandler.c:406:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
00000085 [1963975616] eventhandler.c:423:EHStatusHandlerThread() Card inserted into HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00
00000029 [1963975616] winscard_svc.c:822:MSGSignalClient() Signal client: 6
00000062 [1963975616] winscard_svc.c:825:MSGSignalClient() SIGNAL rv=0x0 for client 6
00000130 [1963975616] Card ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A 
00000034 [1963975616] ifdhandler.c:310:IFDHPolling() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0) 5000 ms
00000025 [1963975616] ccid_usb.c:1327:InterruptRead() before (0), timeout: 5000 ms
00000272 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 6
00000039 [1953493952] winscard_svc.c:834:MSGSendReaderStates() Send reader states: 6
00000300 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 6
00000035 [1953493952] winscard_svc.c:442:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 6
00000529 [1953493952] winscard_svc.c:362:ContextThread() Received command: CONNECT from client 6
00000061 [1953493952] winscard_svc.c:499:ContextThread() Authorized client for 'HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00'
00000027 [1953493952] winscard.c:259:SCardConnect() Attempting Connect to HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00 using protocol: 3
00000026 [1953493952] readerfactory.c:821:RFReaderInfo() RefReader() count was: 1
00000023 [1953493952] winscard.c:352:SCardConnect() powerState: POWER_STATE_IN_USE
00000027 [1953493952] prothandler.c:108:PHSetProtocol() Attempting PTS to T=1
00000030 [1953493952] ifdhandler.c:708:IFDHSetProtocolParameters() protocol T=1, usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000041 [1953493952] ifdhandler.c:1030:IFDHSetProtocolParameters() Timeout: 167723 ms
00000024 [1953493952] commands.c:2265:SetParameters() length: 7 bytes
00000051 [1953493952] -> 000000 61 07 00 00 00 00 08 01 00 00 11 10 00 4D 00 20 00 
00000696 [1953493952] <- 000000 82 07 00 00 00 00 08 00 00 01 11 10 00 4D 00 20 00 
00000048 [1953493952] ifdhandler.c:1100:IFDHSetProtocolParameters() T=1: IFSC=32, IFSD=254
00000031 [1953493952] winscard.c:431:SCardConnect() Active Protocol: T=1
00000042 [1953493952] winscard.c:456:SCardConnect() hCard Identity: 1b3cbb6e
00000033 [1953493952] winscard.c:518:SCardConnect() UnrefReader() count was: 2
00000029 [1953493952] winscard_svc.c:513:ContextThread() CONNECT rv=0x0 for client 6
00000574 [1953493952] winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 6
00000331 [1953493952] winscard_svc.c:362:ContextThread() Received command: STATUS from client 6
00000063 [1953493952] readerfactory.c:848:RFReaderInfoById() RefReader() count was: 1
00000035 [1953493952] winscard.c:1300:SCardStatus() UnrefReader() count was: 2
00000026 [1953493952] winscard_svc.c:632:ContextThread() STATUS rv=0x0 for client 6
00001452 [1953493952] winscard_svc.c:362:ContextThread() Received command: TRANSMIT from client 6
00000118 [1953493952] readerfactory.c:848:RFReaderInfoById() RefReader() count was: 1
00000030 [1953493952] winscard.c:1595:SCardTransmit() Send Protocol: T=1
00000034 [1953493952] APDU: 00 A4 00 0C 02 3F 00 
00000028 [1953493952] ifdhandler.c:1316:IFDHTransmitToICC() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000055 [1953493952] commands.c:1634:CmdXfrBlockAPDU_extended() T=0 (extended): 7 bytes
00000051 [1953493952] -> 000000 6F 07 00 00 00 00 09 00 00 00 00 A4 00 0C 02 3F 00 
00000998 [1953493952] <- 000000 80 02 00 00 00 00 09 00 00 00 6A 81 
00000054 [1953493952] SW: 6A 81 
00000025 [1953493952] winscard.c:1640:SCardTransmit() UnrefReader() count was: 2
00000025 [1953493952] winscard_svc.c:685:ContextThread() TRANSMIT rv=0x0 for client 6
00000443 [1953493952] winscard_svc.c:362:ContextThread() Received command: DISCONNECT from client 6
00000063 [1953493952] readerfactory.c:848:RFReaderInfoById() RefReader() count was: 1
00000025 [1953493952] winscard.c:881:SCardDisconnect() Active Contexts: -1
00000022 [1953493952] winscard.c:882:SCardDisconnect() dwDisposition: 1
00000029 [1953493952] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000042 [1953493952] -> 000000 65 00 00 00 00 00 0A 00 00 00 
00000691 [1953493952] <- 000000 81 00 00 00 00 00 0A 00 00 00 
00000038 [1953493952] ifdhandler.c:1989:IFDHICCPresence() Card present
00000028 [1953493952] ifdhandler.c:1167:IFDHPowerICC() action: Reset, usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000038 [1953493952] -> 000000 62 00 00 00 00 00 0B 00 00 00 
00006924 [1953493952] <- 000000 80 14 00 00 00 00 0B 00 00 00 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A 
00000045 [1953493952] winscard.c:920:SCardDisconnect() Reset complete.
00000049 [1953493952] Card ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 01 00 00 00 00 6A 
00000027 [1953493952] winscard.c:1017:SCardDisconnect() powerState: POWER_STATE_GRACE_PERIOD
00000027 [1953493952] ifdhandler.c:381:IFDHGetCapabilities() tag: 0xFB2, usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000023 [1953493952] winscard.c:1030:SCardDisconnect() Stopping polling thread
00000023 [1953493952] ifdhandler.c:346:IFDHStopPolling() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000070 [1953493952] winscard.c:1043:SCardDisconnect() UnrefReader() count was: 2
00000029 [1953493952] winscard_svc.c:550:ContextThread() DISCONNECT rv=0x0 for client 6
00000037 [1963975616] ccid_usb.c:1373:InterruptRead() after (0) (3)
00000029 [1963975616] ccid_usb.c:1388:InterruptRead() InterruptRead (1/12): 3
00000301 [1953493952] winscard_svc.c:362:ContextThread() Received command: RELEASE_CONTEXT from client 6
00000055 [1953493952] winscard.c:229:SCardReleaseContext() Releasing Context: 0xF7B587E
00000026 [1953493952] winscard_svc.c:476:ContextThread() RELEASE_CONTEXT rv=0x0 for client 6
00000253 [1953493952] winscard_svc.c:354:ContextThread() Client die: 6
00000127 [1953493952] winscard_svc.c:1057:MSGCleanupClient() Thread is stopping: dwClientID=6, threadContext @0x1d2e740
00000026 [1953493952] winscard_svc.c:1063:MSGCleanupClient() Freeing SCONTEXT @0x1d2e740
00399356 [1963975616] eventhandler.c:494:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
00000063 [1963975616] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000047 [1963975616] -> 000000 65 00 00 00 00 00 0C 00 00 00 
00000528 [1963975616] <- 000000 81 00 00 00 00 00 0C 00 00 00 
00000034 [1963975616] ifdhandler.c:1989:IFDHICCPresence() Card present
00000027 [1963975616] ifdhandler.c:310:IFDHPolling() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0) 5000 ms
00000033 [1963975616] ccid_usb.c:1327:InterruptRead() before (0), timeout: 5000 ms
01968805 [1963975616] ccid_usb.c:1373:InterruptRead() after (0) (0)
00000060 [1963975616] NotifySlotChange: 50 02 
00000036 [1963975616] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000049 [1963975616] -> 000000 65 00 00 00 00 00 0D 00 00 00 
00000562 [1963975616] <- 000000 81 00 00 00 00 00 0D 02 00 00 
00000033 [1963975616] ifdhandler.c:1989:IFDHICCPresence() Card absent
00000024 [1963975616] eventhandler.c:482:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED
00000033 [1963975616] ifdhandler.c:1868:IFDHICCPresence() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0)
00000036 [1963975616] -> 000000 65 00 00 00 00 00 0E 00 00 00 
00000491 [1963975616] <- 000000 81 00 00 00 00 00 0E 02 00 00 
00000030 [1963975616] ifdhandler.c:1989:IFDHICCPresence() Card absent
00000024 [1963975616] eventhandler.c:358:EHStatusHandlerThread() Card Removed From HID Global OMNIKEY 5022 Smart Card Reader (KJ-16145171-1919-000030) 00 00
00000038 [1963975616] ifdhandler.c:310:IFDHPolling() usb:076b/5022:libusb-1.0:1:12:0 (lun: 0) 600000 ms
00000024 [1963975616] ccid_usb.c:1327:InterruptRead() before (0), timeout: 600000 ms


More information about the pcsclite-muscle mailing list