Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCSC does not find smart card reader #41

Closed
fernandofrancis opened this issue Jul 12, 2018 · 9 comments
Closed

PCSC does not find smart card reader #41

fernandofrancis opened this issue Jul 12, 2018 · 9 comments

Comments

@fernandofrancis
Copy link

Hello Ludovic, could you help me with the following situation?

When I list the usb in the server, all smart cards reader are listed:

autorizador1:~ # lsusb
Protocol spec without prior Class and Subclass spec at line 17406
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 413c:a001 Dell Computer Corp. Hub
Bus 001 Device 039: ID 08e6:3437 Gemalto (was Gemplus) GemPC Twin SmartCard Reader
Bus 001 Device 040: ID 08e6:3437 Gemalto (was Gemplus) GemPC Twin SmartCard Reader
Bus 001 Device 026: ID 08e6:3437 Gemalto (was Gemplus) GemPC Twin SmartCard Reader
Bus 001 Device 028: ID 08e6:3437 Gemalto (was Gemplus) GemPC Twin SmartCard Reader

Using pcsc_scan It just shows 3 readers:

autorizador1:~ # pcsc_scan
PC/SC device scanner
V 1.4.20 (c) 2001-2011, Ludovic Rousseau [email protected]
Compiled with PC/SC lite version: 1.4.102
Plug'n play reader name not supported. Using polling every 1000 ms.
Scanning present readers...
0: Gemplus GemPC Twin 00 00
1: Gemplus GemPC Twin 01 00
2: Gemplus GemPC Twin 02 00

Thu Jul 12 11:31:31 2018
Reader 0: Gemplus GemPC Twin 00 00
Card state: Card inserted, Shared Mode,
ATR: 3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7

Can't locate Chipcard/PCSC/Card.pm in @inc (@inc contains: /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl .) at /usr/bin/ATR_analysis line 47.
BEGIN failed--compilation aborted at /usr/bin/ATR_analysis line 47.
ATR_analysis '3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7': Success
Reader 1: Gemplus GemPC Twin 01 00
Card state: Card inserted, Shared Mode,
ATR: 3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7

Can't locate Chipcard/PCSC/Card.pm in @inc (@inc contains: /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl .) at /usr/bin/ATR_analysis line 47.
BEGIN failed--compilation aborted at /usr/bin/ATR_analysis line 47.
ATR_analysis '3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7': Success
Reader 2: Gemplus GemPC Twin 02 00
Card state: Card inserted, Shared Mode,
ATR: 3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7

Can't locate Chipcard/PCSC/Card.pm in @inc (@inc contains: /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl .) at /usr/bin/ATR_analysis line 47.
BEGIN failed--compilation aborted at /usr/bin/ATR_analysis line 47.
ATR_analysis '3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7': Success

When I run pcscd with debug, It just find 3 readers:

autorizador1:~ # pcscd --foreground --debug
00000000 pcscdaemon.c:280:main() pcscd set to foreground with debug send to stderr
00000013 debuglog.c:239:DebugLogSetLevel() debug level=debug
00000149 pcscdaemon.c:498:main() pcsc-lite 1.4.102 daemon ready.
00041689 hotplug_libhal.c:305:get_driver() Looking a driver for VID: 0x08E6, PID: 0x3437
00000006 hotplug_libhal.c:342:HPAddDevice() Adding USB device: usb_device_8e6_3437_noserial_0_if0
01000139 readerfactory.c:1082:RFInitializeReader() Attempting startup of Gemplus GemPC Twin 00 00 using /usr/lib64/readers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000090 readerfactory.c:949:RFBindFunctions() Loading IFD Handler 3.0
00000014 ifdhandler.c:1323:init_driver() Driver version: 1.3.8
00000098 ifdhandler.c:1336:init_driver() LogLevel: 0x0003
00000088 ifdhandler.c:1356:init_driver() DriverOptions: 0x0000
00000005 ifdhandler.c:81:IFDHCreateChannelByName() lun: 0, device: usb:08e6/3437:libhal:/org/freedesktop/Hal/devices/usb_device_8e6_3437_noserial_0_if0
00087054 ccid_usb.c:236:OpenUSBByName() Manufacturer: Ludovic Rousseau ([email protected])
00000082 ccid_usb.c:246:OpenUSBByName() ProductString: Generic CCID driver
00000077 ccid_usb.c:252: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.
00000443 ccid_usb.c:408:OpenUSBByName() Found Vendor/Product: 08E6/3437 (Gemplus GemPC Twin)
00000004 ccid_usb.c:410:OpenUSBByName() Using USB bus/device: 001/040
00002954 ccid_usb.c:816:get_data_rates() declared: 10753 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 14337 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 15625 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 17204 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 20833 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 21505 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 23438 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 25806 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 28674 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 31250 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 32258 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 34409 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 39063 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 41667 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 43011 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 46875 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 52083 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 53763 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 57348 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 62500 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 64516 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 68817 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 71685 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 78125 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 83333 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 86022 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 93750 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 104167 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 107527 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 114695 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 125000 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 129032 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 143369 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 156250 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 166667 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 172043 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 215054 bps
00000007 ccid_usb.c:816:get_data_rates() declared: 229391 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 250000 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 344086 bps
00000332 ifdhandler.c:307:IFDHGetCapabilities() lun: 0, tag: 0xFB0
00000003 readerfactory.c:267:RFAddReader() Using the pcscd polling thread
00000392 ifdhandler.c:307:IFDHGetCapabilities() lun: 0, tag: 0xFAE
00000004 ifdhandler.c:353:IFDHGetCapabilities() Reader supports 1 slot(s)
00000300 hotplug_libhal.c:305:get_driver() Looking a driver for VID: 0x1D6B, PID: 0x0002
00000302 hotplug_libhal.c:305:get_driver() Looking a driver for VID: 0x08E6, PID: 0x3437
00000007 hotplug_libhal.c:342:HPAddDevice() Adding USB device: usb_device_8e6_3437_noserial_2_if0
00000118 ifdhandler.c:924:IFDHPowerICC() lun: 0, action: PowerUp
00045233 Card ATR: 3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7
00954793 ifdhandler.c:307:IFDHGetCapabilities() lun: 0, tag: 0xFAF
00000006 readerfactory.c:559:RFSetReaderName() Support 16 simultaneous readers
00000004 ifdhandler.c:307:IFDHGetCapabilities() lun: 0, tag: 0xFAD
00000003 readerfactory.c:209:RFAddReader() Driver is thread safe
00000005 readerfactory.c:1082:RFInitializeReader() Attempting startup of Gemplus GemPC Twin 01 00 using /usr/lib64/readers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000004 readerfactory.c:794:RFLoadReader() Reusing already loaded driver for /usr/lib64/readers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000008 readerfactory.c:949:RFBindFunctions() Loading IFD Handler 3.0
00000009 ifdhandler.c:81:IFDHCreateChannelByName() lun: 10000, device: usb:08e6/3437:libhal:/org/freedesktop/Hal/devices/usb_device_8e6_3437_noserial_2_if0
00000155 ccid_usb.c:236:OpenUSBByName() Manufacturer: Ludovic Rousseau ([email protected])
00000080 ccid_usb.c:246:OpenUSBByName() ProductString: Generic CCID driver
00000078 ccid_usb.c:252: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.
00000433 ccid_usb.c:354:OpenUSBByName() USB device 001/040 already in use. Checking next one.
00000011 ccid_usb.c:408:OpenUSBByName() Found Vendor/Product: 08E6/3437 (Gemplus GemPC Twin)
00000004 ccid_usb.c:410:OpenUSBByName() Using USB bus/device: 001/039
00002651 ccid_usb.c:816:get_data_rates() declared: 10753 bps
00000006 ccid_usb.c:816:get_data_rates() declared: 14337 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 15625 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 17204 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 20833 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 21505 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 23438 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 25806 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 28674 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 31250 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 32258 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 34409 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 39063 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 41667 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 43011 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 46875 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 52083 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 53763 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 57348 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 62500 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 64516 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 68817 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 71685 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 78125 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 83333 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 86022 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 93750 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 104167 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 107527 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 114695 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 125000 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 129032 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 143369 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 156250 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 166667 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 172043 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 215054 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 229391 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 250000 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 344086 bps
00000352 ifdhandler.c:307:IFDHGetCapabilities() lun: 10000, tag: 0xFB0
00000003 readerfactory.c:267:RFAddReader() Using the pcscd polling thread
00000392 ifdhandler.c:307:IFDHGetCapabilities() lun: 10000, tag: 0xFAE
00000004 ifdhandler.c:353:IFDHGetCapabilities() Reader supports 1 slot(s)
00000288 hotplug_libhal.c:305:get_driver() Looking a driver for VID: 0x08E6, PID: 0x3437
00000005 hotplug_libhal.c:342:HPAddDevice() Adding USB device: usb_device_8e6_3437_noserial_1_if0
00000398 ifdhandler.c:924:IFDHPowerICC() lun: 10000, action: PowerUp
00045241 Card ATR: 3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7
00954507 ifdhandler.c:307:IFDHGetCapabilities() lun: 0, tag: 0xFAF
00000006 readerfactory.c:559:RFSetReaderName() Support 16 simultaneous readers
00000003 ifdhandler.c:307:IFDHGetCapabilities() lun: 10000, tag: 0xFAF
00000003 readerfactory.c:559:RFSetReaderName() Support 16 simultaneous readers
00000003 ifdhandler.c:307:IFDHGetCapabilities() lun: 10000, tag: 0xFAD
00000005 readerfactory.c:209:RFAddReader() Driver is thread safe
00000003 readerfactory.c:1082:RFInitializeReader() Attempting startup of Gemplus GemPC Twin 02 00 using /usr/lib64/readers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000002 readerfactory.c:794:RFLoadReader() Reusing already loaded driver for /usr/lib64/readers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000010 readerfactory.c:949:RFBindFunctions() Loading IFD Handler 3.0
00000010 ifdhandler.c:81:IFDHCreateChannelByName() lun: 20000, device: usb:08e6/3437:libhal:/org/freedesktop/Hal/devices/usb_device_8e6_3437_noserial_1_if0
00000142 ccid_usb.c:236:OpenUSBByName() Manufacturer: Ludovic Rousseau ([email protected])
00000079 ccid_usb.c:246:OpenUSBByName() ProductString: Generic CCID driver
00000077 ccid_usb.c:252: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.
00000432 ccid_usb.c:354:OpenUSBByName() USB device 001/040 already in use. Checking next one.
00000004 ccid_usb.c:354:OpenUSBByName() USB device 001/039 already in use. Checking next one.
00000010 ccid_usb.c:408:OpenUSBByName() Found Vendor/Product: 08E6/3437 (Gemplus GemPC Twin)
00000004 ccid_usb.c:410:OpenUSBByName() Using USB bus/device: 001/028
00002847 ccid_usb.c:816:get_data_rates() declared: 10753 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 14337 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 15625 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 17204 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 20833 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 21505 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 23438 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 25806 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 28674 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 31250 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 32258 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 34409 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 39063 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 41667 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 43011 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 46875 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 52083 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 53763 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 57348 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 62500 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 64516 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 68817 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 71685 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 78125 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 83333 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 86022 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 93750 bps
00000004 ccid_usb.c:816:get_data_rates() declared: 104167 bps
00000002 ccid_usb.c:816:get_data_rates() declared: 107527 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 114695 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 125000 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 129032 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 143369 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 156250 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 166667 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 172043 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 215054 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 229391 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 250000 bps
00000003 ccid_usb.c:816:get_data_rates() declared: 344086 bps
00000348 ifdhandler.c:307:IFDHGetCapabilities() lun: 20000, tag: 0xFB0
00000003 readerfactory.c:267:RFAddReader() Using the pcscd polling thread
00000375 ifdhandler.c:307:IFDHGetCapabilities() lun: 20000, tag: 0xFAE
00000004 ifdhandler.c:353:IFDHGetCapabilities() Reader supports 1 slot(s)
00000747 ifdhandler.c:924:IFDHPowerICC() lun: 20000, action: PowerUp
00004001 hotplug_libhal.c:305:get_driver() Looking a driver for VID: 0x1D6B, PID: 0x0003
00000255 hotplug_libhal.c:305:get_driver() Looking a driver for VID: 0x413C, PID: 0xA001
00000254 hotplug_libhal.c:305:get_driver() Looking a driver for VID: 0x1D6B, PID: 0x0002
00040751 Card ATR: 3B F8 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34 31 B7

Is there any limitation with the amount of readers or anything else?

@LudovicRousseau
Copy link
Owner

The limit is 16 readers. So that is not the problem here.
The missing reader is Device 026.
What happens if you unplug and re-plug this device?

@fernandofrancis
Copy link
Author

Ludovic, thanks for your quickly reponse.

The server is at a costumer's company, so I needed to wait somebody help me with the tests.
Following the results of the tests that I made:

Unpluged and re-pluged the device on the same USB = nothing changed, still does not work.

Unpluged and re-pluged the device in other USB = The reader worked but other reader stops working.

Unpluged and re-pluged the device on other USB using a new reader = All reader are working now.

Do you think that could be something with the "internal reader's ID", maybe a conflict?

@LudovicRousseau
Copy link
Owner

Your pcsc-lite is (very) old. 1.4.102 was released in May 2007.
I propose to upgrade pcsc-lite and use libudev instead of libhal to handle hotplug.

@fernandofrancis
Copy link
Author

I'm using SUSE Linux Enterprise Server 11 (x86_64) SP3.

Is the last version compatible or I need to upgrade de SO also?

@LudovicRousseau
Copy link
Owner

You should be able to rebuild a recent version of pcsc-lite.
https://pcsclite.apdu.fr/
I don't know if your version of SUSE provides libudev-dev .

You can test pcscd alone without installing it.

@fernandofrancis
Copy link
Author

Ok. I'll do that.
Thanks a lot for your support.

@fernandofrancis
Copy link
Author

Could you tell me how Do I test pcscd alone without installing it?

@LudovicRousseau
Copy link
Owner

After compilation, start it from the project directory:

sudo LIBCCID_ifdLogLevel=0x000F ./src/pcscd --foreground --debug --apdu

@LudovicRousseau
Copy link
Owner

No news since 4 months. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants