Giter Club home page Giter Club logo

pcsc's People

Contributors

0mp avatar createyourpersonalaccount avatar dpward avatar eli-schwartz avatar emaxx-google avatar eworm-de avatar ffontaine avatar fltt avatar frankmorgner avatar freswa avatar gabrielesvelto avatar jakuje avatar kirelagin avatar lekensteyn avatar lo1ol avatar ludovicrousseau avatar martinpaljak avatar ndusart avatar oliviermartin avatar spaette avatar st4lkerino avatar tharre avatar vjardin avatar ww0nka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pcsc's Issues

SCardConnect returns SCARD_E_PROTO_MISMATCH if SCARD_PROTOCOL_RAW was used in previous connection

I found a problem when using SCardConnect with SCARD_PROTOCOL_RAW. It always returns SCARD_E_PROTO_MISMATCH if SCARD_PROTOCOL_RAW was used in previous connection.

Please insert a card before running testraw.
After running testraw, it will generate the following output:

Establishing the context...
Getting reader names...
Reader 0: ACS ACR 38U-CCID 00 00
Select reader: 0
Connecting to the reader (shared, T=0 or T=1)...
Disconnecting the reader...
Connecting to the reader (direct, raw)...
Disconnecting the reader...
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Connecting to the reader (shared, T=0 or T=1)...
Error: SCardConnect failed with error 0x8010000F
Releasing the context...

Here is the test code (testraw.c.txt).
Here is the log from pcscd (log.txt).

limit 16 reader

as it does to remove the 16 reader limit must use 24 pc a reader would like to help me?

Memory leaks in ScardEstablishContext()

I use libpcsclite and recently faced with some memory leaks while running ScardEstablishContext() under Valgrind.

I came across this link and tried to find topic about it, but unsuccessfully.

I’ve made this sample to reproduce leaks.

g++ test_leaks.cpp -o test_leaks -ldl -I/usr/include/PCSC
//test_leaks.cpp
 
#include <dlfcn.h>
#include <cstddef>
#include <winscard.h>

int main()
{
     typedef LONG (*SCardEstablishContext_t)(DWORD, LPCVOID,LPCVOID,LPSCARDCONTEXT);
     typedef LONG (*SCardReleaseContext_t)(SCARDCONTEXT);

     void* module = dlopen("libpcsclite.so", RTLD_NOW);

     SCardEstablishContext_t SCardEstablishContext = (SCardEstablishContext_t)dlsym(module, "SCardEstablishContext");
     SCardReleaseContext_t SCardReleaseContext = (SCardReleaseContext_t)dlsym(module, "SCardReleaseContext");

     SCARDCONTEXT ctx;
     SCardEstablishContext(0, NULL, NULL, &ctx);
     SCardReleaseContext(ctx);

     dlclose(module);
     return 0;
}

Valgrind report

valgrind ./test_leaks
==9662== Memcheck, a memory error detector
==9662== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==9662== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==9662== Command: ./test_leaks
==9662== 
==9662== 
==9662== HEAP SUMMARY:
==9662==     in use at exit: 1,860 bytes in 9 blocks
==9662==   total heap usage: 19 allocs, 10 frees, 3,741 bytes allocated
==9662== 
==9662== LEAK SUMMARY:
==9662==    definitely lost: 40 bytes in 1 blocks
==9662==    indirectly lost: 72 bytes in 3 blocks
==9662==      possibly lost: 0 bytes in 0 blocks
==9662==    still reachable: 1,748 bytes in 5 blocks
==9662==         suppressed: 0 bytes in 0 blocks
==9662== Rerun with --leak-check=full to see details of leaked memory
==9662== 
==9662== For counts of detected and suppressed errors, rerun with: -v
==9662== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Was it fixed or what can I do to imporve the situation?

Thanks for attention.

Parsing not well formatted /etc/libccid_Info.plist causes invalid pointer error.

Related to monero-project/monero#4157

By mistake, I added two lines instead of one in one section of /etc/libccid_Info.plist, and i got this error.

➜  monero ./monero-wallet-cli --generate-from-device MoneroWallet --subaddress-lookahead 3:200
This is the command line monero wallet. It needs to connect to a monero
daemon to work correctly.                                                                                                                       
WARNING: Do not reuse your Monero keys on an another fork, UNLESS this fork has key reuse mitigations built in. Doing so will harm your privacy.
                                         
Monero 'Lithium Luna' (v0.12.2.0-release)
Logging to ./monero-wallet-cli.log  
Enter a new password for the wallet:
Confirm password:                                                                                                                 
*** Error in `./monero-wallet-cli': munmap_chunk(): invalid pointer: 0x00007fffc1b47480 ***                                                                                                                              ======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f0942a067e5]                                                                        
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x1a8)[0x7f0942a13698]                                                         
/lib/x86_64-linux-gnu/libpcsclite.so.1(SCardFreeMemory+0x1d)[0x7f09434872bd]
./monero-wallet-cli(_ZN2hw6ledger13device_ledger7connectEv+0x6f4)[0x559c9ee26b04]
./monero-wallet-cli(_ZN10cryptonote12account_base18create_from_deviceERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x1f8)[0x559c9edf7378]
./monero-wallet-cli(_ZN5tools7wallet27restoreERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKN4epee15wipeable_stringES8_+0x23b)[0x559c9ebbcb6b]
./monero-wallet-cli(_ZN10cryptonote13simple_wallet10new_walletERKN5boost15program_options13variables_mapERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xf4)[0x559c9ea630e4]
./monero-wallet-cli(_ZN10cryptonote13simple_wallet4initERKN5boost15program_options13variables_mapE+0x190c)[0x559c9ea7b1bc]
./monero-wallet-cli(main+0x355)[0x559c9ea38af5]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f09429af830]
./monero-wallet-cli(_start+0x29)[0x559c9ea458c9]                        
======= Memory map: ========  
559c9e63a000-559c9f3bd000 r-xp 00000000 00:2c 7090873                    /home/danny/nodes/monero/monero-gui-v0.12.2.0/monero-wallet-cli
559c9f5bd000-559c9f605000 r--p 00d83000 00:2c 7090873                    /home/danny/nodes/monero/monero-gui-v0.12.2.0/monero-wallet-cli
559c9f605000-559c9f620000 rw-p 00dcb000 00:2c 7090873                    /home/danny/nodes/monero/monero-gui-v0.12.2.0/monero-wallet-cli
559c9f620000-559c9f659000 rw-p 00000000 00:00 0                                                                                                 
559c9fa0d000-559c9fb73000 rw-p 00000000 00:00 0                          [heap]
7f0941750000-7f0941766000 r-xp 00000000 fc:01 30675344                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f0941766000-7f0941965000 ---p 00016000 fc:01 30675344                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f0941965000-7f0941966000 rw-p 00015000 fc:01 30675344                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f0941966000-7f0941a66000 r--s 00000000 00:2c 23596262                   /home/danny/.shared-ringdb/data.mdb
7f0941a66000-7f0941e68000 rw-p 00000000 00:00 0                                                                                   
7f0941e68000-7f0941e69000 ---p 00000000 00:00 0
7f0941e69000-7f0942669000 rw-p 00000000 00:00 0
7f0942669000-7f094298f000 r--p 00000000 fc:01 12061994                   /usr/lib/locale/locale-archive
7f094298f000-7f0942b4f000 r-xp 00000000 fc:01 30676421                   /lib/x86_64-linux-gnu/libc-2.23.so
7f0942b4f000-7f0942d4f000 ---p 001c0000 fc:01 30676421                   /lib/x86_64-linux-gnu/libc-2.23.so
7f0942d4f000-7f0942d53000 r--p 001c0000 fc:01 30676421                   /lib/x86_64-linux-gnu/libc-2.23.so
7f0942d53000-7f0942d55000 rw-p 001c4000 fc:01 30676421                   /lib/x86_64-linux-gnu/libc-2.23.so
7f0942d55000-7f0942d59000 rw-p 00000000 00:00 0
7f0942d59000-7f0942d71000 r-xp 00000000 fc:01 30676420                   /lib/x86_64-linux-gnu/libpthread-2.23.so
7f0942d71000-7f0942f70000 ---p 00018000 fc:01 30676420                   /lib/x86_64-linux-gnu/libpthread-2.23.so
7f0942f70000-7f0942f71000 r--p 00017000 fc:01 30676420                   /lib/x86_64-linux-gnu/libpthread-2.23.so
7f0942f71000-7f0942f72000 rw-p 00018000 fc:01 30676420                   /lib/x86_64-linux-gnu/libpthread-2.23.so
7f0942f72000-7f0942f76000 rw-p 00000000 00:00 0
7f0942f76000-7f094307e000 r-xp 00000000 fc:01 30671051                   /lib/x86_64-linux-gnu/libm-2.23.so
7f094307e000-7f094327d000 ---p 00108000 fc:01 30671051                   /lib/x86_64-linux-gnu/libm-2.23.so
7f094327d000-7f094327e000 r--p 00107000 fc:01 30671051                   /lib/x86_64-linux-gnu/libm-2.23.so
7f094327e000-7f094327f000 rw-p 00108000 fc:01 30671051                   /lib/x86_64-linux-gnu/libm-2.23.so
7f094327f000-7f0943282000 r-xp 00000000 fc:01 30676423                   /lib/x86_64-linux-gnu/libdl-2.23.so
7f0943282000-7f0943481000 ---p 00003000 fc:01 30676423                   /lib/x86_64-linux-gnu/libdl-2.23.so
7f0943481000-7f0943482000 r--p 00002000 fc:01 30676423                   /lib/x86_64-linux-gnu/libdl-2.23.so
7f0943482000-7f0943483000 rw-p 00003000 fc:01 30676423                   /lib/x86_64-linux-gnu/libdl-2.23.so
7f0943483000-7f094348d000 r-xp 00000000 fc:01 30675407                   /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0
7f094348d000-7f094368c000 ---p 0000a000 fc:01 30675407                   /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0
7f094368c000-7f094368d000 r--p 00009000 fc:01 30675407                   /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0
7f094368d000-7f094368e000 rw-p 0000a000 fc:01 30675407                   /lib/x86_64-linux-gnu/libpcsclite.so.1.0.0
7f094368e000-7f09436b4000 r-xp 00000000 fc:01 30676419                   /lib/x86_64-linux-gnu/ld-2.23.so
7f0943789000-7f094388f000 rw-p 00000000 00:00 0
7f09438b0000-7f09438b1000 rw-p 00000000 00:00 0
7f09438b1000-7f09438b3000 rw-s 00000000 00:2c 23595145                   /home/danny/.shared-ringdb/lock.mdb
7f09438b3000-7f09438b4000 r--p 00025000 fc:01 30676419                   /lib/x86_64-linux-gnu/ld-2.23.so
7f09438b4000-7f09438b5000 rw-p 00026000 fc:01 30676419                   /lib/x86_64-linux-gnu/ld-2.23.so
7f09438b5000-7f09438b6000 rw-p 00000000 00:00 0
7fffc1b2c000-7fffc1b52000 rw-p 00000000 00:00 0                          [stack]
7fffc1b79000-7fffc1b7c000 r--p 00000000 00:00 0                          [vvar]
7fffc1b7c000-7fffc1b7e000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
[1]    6768 abort (core dumped)  ./monero-wallet-cli --generate-from-device MoneroWallet --subaddress-lookahea

Reader not detected when disconnecting / connecting usb hub

Scenario description

OS: Debian Jessie
[email protected]
[email protected]
Two card readers connected through a USB HUB. The readers are:

  • OMNIKEY CardMan (076B:5121) 5121
  • OMNIKEY CardMan (076B:3021) 3021

I'm using the proprietary ccid driver from OMNIKEY

From time to time, if the hub is disconnected and connected immediately the second reader(3021) is not correctly opened by pcscd even though is correctly detected by the kernel. The relevant logs from pcscd seem to be:

00000073 winscard.c:927:SCardDisconnect() Error powering down card: -2146435049 0x80100017
00000061 winscard.c:1040:SCardDisconnect() UnrefReader() count was: 1
00000031 eventhandler.c:173:EHDestroyEventHandler() Stomping thread.
00000028 eventhandler.c:202:EHDestroyEventHandler() Waiting polling thread
00219585 eventhandler.c:334:EHStatusHandlerThread() Error communicating to: OMNIKEY CardMan (076B:3021) 3021 01 00
00083070 hotplug_libudev.c:651:HPEstablishUSBNotifications() USB Device add
00000868 hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x076B, PID: 0x3021, path: /dev/bus/usb/001/104
00000472 hotplug_libudev.c:436:HPAddDevice() Adding USB device: OMNIKEY CardMan (076B:3021) 3021
00000602 readerfactory.c:246:RFAddReader() Duplicate reader found.
00000379 hotplug_libudev.c:523:HPAddDevice() Failed adding USB device: OMNIKEY CardMan (076B:3021) 3021
00000056 readerfactory.c:246:RFAddReader() Duplicate reader found.
00000029 hotplug_libudev.c:533:HPAddDevice() Failed adding USB device: OMNIKEY CardMan (076B:3021) 3021
00314770 eventhandler.c:502:EHStatusHandlerThread() Die
00000346 eventhandler.c:213:EHDestroyEventHandler() Thread stomped.
00000052 readerfactory.c:1124:RFUnInitializeReader() Attempting shutdown of OMNIKEY CardMan (076B:3021) 3021 01 00.

Find attached the full pcscd log:

log2.txt

Any help with this issue would be appreciated.

Thanks in advance.

Error parsing Info.plist file

I attempted to add a new USB CCID device (a new Feitian USB CCID product called K9) into the Info.plist and restarted the pcscd but it seems to show that there is an error parsing the Info.plist.

I am running the setup on an ARM Linux.

I ran a 'sudo pcscd -d -f' which displayed the parsing error. The Info.plist contained in the ZIP file contains the 'Feitian CCID K9' entry with the Vendor ID of 096E and Product ID of 0856.

parse-err.zip

Unable to init usb readers

Loading libscmccid 5.0.35
04236586 ifdhandler.c:1158:IFDHPowerICC() action: PowerDown, usb:04e6/5721:libudev:1:/dev/bus/usb/001/003 (lun: 0)
00016897 eventhandler.c:481:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED
10761997 readerfactory.c:1043:RFInitializeReader() Open Port 0x200006 Failed (usb:04e6/5721:libudev:0:/dev/bus/usb/001/005)
00000048 readerfactory.c:335:RFAddReader() Identiv uTRust 4710 F CL + SAM Reader [CLOUD 4710 F SAM Reader] (53241322202448) init failed.
00000012 readerfactory.c:558:RFRemoveReader() UnrefReader() count was: 1
00000008 readerfactory.c:1063:RFUnInitializeReader() Attempting shutdown of Identiv uTRust 4710 F CL + SAM Reader [CLOUD 4710 F SAM Reader] (53241322202448) 05 00.
00000012 hotplug_libudev.c:507:HPAddDevice() Failed adding USB device: Identiv uTRust 4710 F CL + SAM Reader
00000017 ifdhandler.c:382:IFDHGetCapabilities() tag: 0xFAF, usb:04e6/5721:libudev:1:/dev/bus/usb/001/003 (lun: 0)
00000010 readerfactory.c:680:RFSetReaderName() Support 16 simultaneous readers
00000015 ifdhandler.c:382:IFDHGetCapabilities() tag: 0xFAD, usb:04e6/5721:libudev:1:/dev/bus/usb/001/003 (lun: 0)
00000006 readerfactory.c:297:RFAddReader() Driver is thread safe
00000010 readerfactory.c:1012:RFInitializeReader() Attempting startup of Identiv uTRust 4710 F CL + SAM Reader [CLOUD 4710 F SAM Reader] (53241322202448) 01 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000026 readerfactory.c:811:RFLoadReader() Reusing already loaded driver for /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000026 readerfactory.c:897:RFBindFunctions() Loading IFD Handler 3.0
00000033 ifdhandler.c:111:CreateChannelByNameOrChannel() Lun: 10000, device: usb:04e6/5721:libudev:0:/dev/bus/usb/001/005
00000019 ccid_usb.c:302:OpenUSBByName() Using: /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
00001309 ccid_usb.c:320:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau ([email protected])
00000015 ccid_usb.c:321:OpenUSBByName() ifdProductString: Generic CCID driver
00000009 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.
00000354 ccid_usb.c:656:OpenUSBByName() Found Vendor/Product: 04E6/5721 (Identive Identive CLOUD 4510 F Contactless + SAM Reader)
00000012 ccid_usb.c:658:OpenUSBByName() Using USB bus/device: 1/5
00000008 ccid_usb.c:717:OpenUSBByName() bNumDataRatesSupported is 0
07541745 ccid_usb.c:849:WriteUSB() write failed (1/5): -7 LIBUSB_ERROR_TIMEOUT
05000193 ccid_usb.c:849:WriteUSB() write failed (1/5): -7 LIBUSB_ERROR_TIMEOUT
05000182 ccid_usb.c:849:WriteUSB() write failed (1/5): -7 LIBUSB_ERROR_TIMEOUT
00000025 ifdhandler.c:195:CreateChannelByNameOrChannel() failed
00000078 readerfactory.c:1043:RFInitializeReader() Open Port 0x200006 Failed (usb:04e6/5721:libudev:0:/dev/bus/usb/001/005)
00000041 readerfactory.c:335:RFAddReader() Identiv uTRust 4710 F CL + SAM Reader [CLOUD 4710 F SAM Reader] (53241322202448) init failed.
00000019 readerfactory.c:558:RFRemoveReader() UnrefReader() count was: 1
00000014 readerfactory.c:1063:RFUnInitializeReader() Attempting shutdown of Identiv uTRust 4710 F CL + SAM Reader [CLOUD 4710 F SAM Reader] (53241322202448) 01 00.
00000017 hotplug_libudev.c:517:HPAddDevice() Failed adding USB device: Identiv uTRust 4710 F CL + SAM Reader
00000407 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x04E6, PID: 0x5721, path: /dev/bus/usb/001/005

Not sure what is it struggling for

global symbol issues linking with -fvisibility=hidden on SunOS

When building 1.8.16 under SunOS 5.11 (illumos distro), if I don't filter out -fvisibility=hidden
I get the following linker error with:

  CCLD     testpcsc
Undefined           first referenced
 symbol                 in file
SCardListReaders                    testpcsc.o
SCardSetAttrib                      testpcsc.o
SCardGetAttrib                      testpcsc.o
g_rgSCardRawPci                     testpcsc.o
SCardReconnect                      testpcsc.o
SCardFreeMemory                     testpcsc.o
SCardDisconnect                     testpcsc.o
SCardReleaseContext                 testpcsc.o
SCardIsValidContext                 testpcsc.o
SCardEstablishContext               testpcsc.o
SCardGetStatusChange                testpcsc.o
SCardListReaderGroups               testpcsc.o
SCardStatus                         testpcsc.o
pcsc_stringify_error                testpcsc.o
SCardControl                        testpcsc.o
SCardConnect                        testpcsc.o
g_rgSCardT1Pci                      testpcsc.o
g_rgSCardT0Pci                      testpcsc.o
SCardTransmit                       testpcsc.o
ld: fatal: symbol referencing errors. No output written to .libs/testpcsc

I'm running on pkgsrc SunOS i386 with gcc49 and native ld.
BTW, I have more or less the same issue with ccid.

ccid_usb.c ReadUSB read failed: -7 LIBUSB_ERROR_TIMEOUT

I'm having trouble with an "Identiv uTrust 3700 F CL Reader".
Here is the full pcscd debug log.
I don't know if it is a bug or if I'm missing something...
Can anyone help me with that?

I'm using a Raspberry Pi 3 with Raspbian GNU/Linux 9 (stretch) and Linux version 4.9.59-v7+

00000000 debuglog.c:289:DebugLogSetLevel() debug level=debug
00000270 debuglog.c:310:DebugLogSetCategory() Debug options: APDU
00000021 pcscdaemon.c:351:main() Force colored logs
00000414 configfile.l:282:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00000074 configfile.l:358:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00000259 configfile.l:319:DBGetReaderListDir() Skipping non regular file: ..
00000024 configfile.l:319:DBGetReaderListDir() Skipping non regular file: .
00000028 pcscdaemon.c:655:main() pcsc-lite 1.8.20 daemon ready.
00015027 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000853 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00000895 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 0x0424, PID: 0x9514, path: /dev/bus/usb/001/002
00000956 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 0x0424, PID: 0xEC00, path: /dev/bus/usb/001/003
00000894 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 0x0424, PID: 0x9514, path: /dev/bus/usb/001/002
05118061 hotplug_libudev.c:648:HPEstablishUSBNotifications() USB Device add
00000956 hotplug_libudev.c:294:get_driver() Looking for a driver for VID: 0x04E6, PID: 0x5790, path: /dev/bus/usb/001/008
00000181 hotplug_libudev.c:433:HPAddDevice() Adding USB device: Identiv uTrust 3700 F CL Reader
00000553 readerfactory.c:1079:RFInitializeReader() Attempting startup of Identiv uTrust 3700 F CL Reader [uTrust 3700 F CL Reader] (55021722283450) 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00001448 readerfactory.c:954:RFBindFunctions() Loading IFD Handler 3.0
00000333 ifdhandler.c:1961:init_driver() Driver version: 1.4.26
00005946 ifdhandler.c:1978:init_driver() LogLevel: 0x0003
00000187 ifdhandler.c:1989:init_driver() DriverOptions: 0x0000
00001088 ifdhandler.c:2002:init_driver() LogLevel from LIBCCID_ifdLogLevel: 0x000F
00000107 ifdhandler.c:111:CreateChannelByNameOrChannel() Lun: 0, device: usb:04e6/5790:libudev:0:/dev/bus/usb/001/008
00000092 ccid_usb.c:237:OpenUSBByName() Reader index: 0, Device: usb:04e6/5790:libudev:0:/dev/bus/usb/001/008
00000153 ccid_usb.c:269:OpenUSBByName() interface_number: 0
00000086 ccid_usb.c:270:OpenUSBByName() usb bus/device: 1/8
00000080 ccid_usb.c:287:OpenUSBByName() Using: /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
00006031 ccid_usb.c:305:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau ([email protected])
00000160 ccid_usb.c:306:OpenUSBByName() ifdProductString: Generic CCID driver
00000091 ccid_usb.c:307: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.
00011185 ccid_usb.c:391:OpenUSBByName() Try device: 1/8
00000218 ccid_usb.c:401:OpenUSBByName() vid/pid : 04E6/5790
00000089 ccid_usb.c:448:OpenUSBByName() Checking device: 1/8
00000084 ccid_usb.c:519:OpenUSBByName() Trying to open USB bus/device: 1/8
00000442 ccid_usb.c:621:OpenUSBByName() Found Vendor/Product: 04E6/5790 (Identiv uTrust 3700 F CL Reader)
00000105 ccid_usb.c:623:OpenUSBByName() Using USB bus/device: 1/8
00000085 ccid_usb.c:680:OpenUSBByName() bNumDataRatesSupported is 0
00006731 ccid_usb.c:1244:InterruptRead() before (0)
00100314 ccid_usb.c:1290:InterruptRead() after (0) (2)
00000172 -> 000000 65 00 00 00 00 00 00 00 00 00
00890566 <- 000000 81 00 00 00 00 00 00 42 FE 01
00000280 -> 000000 65 00 00 00 00 00 01 00 00 00
00100927 ccid_usb.c:836:ReadUSB() read failed (1/8): -7 LIBUSB_ERROR_TIMEOUT
00000415 -> 000000 65 00 00 00 00 00 02 00 00 00
00100553 ccid_usb.c:836:ReadUSB() read failed (1/8): -7 LIBUSB_ERROR_TIMEOUT
00000188 ifdhandler.c:195:CreateChannelByNameOrChannel() failed
00000126 ccid_usb.c:879:CloseUSB() Closing USB device: 1/8
00000117 ccid_usb.c:889:CloseUSB() Last slot closed. Release resources
00000460 ccid_usb.c:189:close_libusb_if_needed() libusb_exit
00000626 readerfactory.c:1110:RFInitializeReader() Open Port 0x200000 Failed (usb:04e6/5790:libudev:0:/dev/bus/usb/001/008)
00000351 readerfactory.c:375:RFAddReader() Identiv uTrust 3700 F CL Reader [uTrust 3700 F CL Reader] (55021722283450) init failed.
00000154 readerfactory.c:608:RFRemoveReader() UnrefReader() count was: 1
00000123 readerfactory.c:1130:RFUnInitializeReader() Attempting shutdown of Identiv uTrust 3700 F CL Reader [uTrust 3700 F CL Reader] (55021722283450) 00 00.
00000125 readerfactory.c:991:RFUnloadReader() Unloading reader driver.
00000301 hotplug_libudev.c:520:HPAddDevice() Failed adding USB device: Identiv uTrust 3700 F CL Reader

Leaking sockets

Hello,

it seems libpcsc is leaking sockets if connection is dropped by e.g. polkit. From my (brief) investigation, while socket is created in ClientSetupSession() called from SCardEstablishContextTH(), resulting socket in dwClientID is not stored in context until the end of this session, while you can exit on e.g. MessageReceive() failure in the very next block after ClientSetupSession().
This leads to growing number of open files, should the application repeatedly try to call SCardEstablishContext(), and eventually everything explodes...

Did I miss anything?

Thanks,
Martin

Can not find the RFID reader

Hello !
Can not find the RFID reader on pcsc_scan =>
screen_pcsc_scan

It is sure that the RFID reader works because I have already run on a raspberry with PCSC
(but here I am not on a raspberry)

But the reader is found with lsusb =>
Bus 001 Device 020: ID 072f:2224 Advanced Card Systems, Ltd ACR1281 1S Dual Reader

I tried too https://ludovicrousseau.blogspot.com/2013/11/linux-nfc-driver-conflicts-with-ccid.html
But it does not work.

Someone can help me ?
thank you in advance

have a nice day

Versions

ccid-1.4.29-1 (libccid)
reader ACR1281U
/usr/sbin/pcscd --version =>
pcsc-lite version 1.8.23.
Copyright (C) 1999-2002 by David Corcoran [email protected].
Copyright (C) 2001-2015 by Ludovic Rousseau [email protected].
Copyright (C) 2003-2004 by Damien Sauveron [email protected].
Report bugs to [email protected].
Enabled features: Linux x86_64-pc-linux-gnu libsystemd serial usb libudev usbdropdir=/usr/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/etc/reader.conf.d

Platform

screen_version

log.txt

00000000 debuglog.c:289:DebugLogSetLevel() debug level=debug
00000012 debuglog.c:310:DebugLogSetCategory() Debug options: APDU
�[36m00000002�[0m �[34mpcscdaemon.c:352:main() Force colored logs�[0m
�[36m00000066�[0m configfile.l:285:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
�[36m00000028�[0m configfile.l:361:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
�[36m00000036�[0m configfile.l:322:DBGetReaderListDir() Skipping non regular file: ..
�[36m00000006�[0m configfile.l:322:DBGetReaderListDir() Skipping non regular file: .
�[36m00000006�[0m �[34mpcscdaemon.c:662:main() pcsc-lite 1.8.23 daemon ready.�[0m
�[36m00003090�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
�[36m00000104�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
�[36m00000108�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x072F, PID: 0x2224, path: /dev/bus/usb/001/019
�[36m00000097�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
�[36m00000107�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0AAA, path: /dev/bus/usb/001/005
�[36m00000104�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x8087, PID: 0x0AAA, path: /dev/bus/usb/001/005
�[36m00000097�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
�[36m00000103�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x05E3, PID: 0x0610, path: /dev/bus/usb/001/002
�[36m00000109�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x046D, PID: 0xC050, path: /dev/bus/usb/001/004
�[36m00000103�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x05E3, PID: 0x0610, path: /dev/bus/usb/001/002
�[36m00000107�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x0BDA, PID: 0x8153, path: /dev/bus/usb/001/006
�[36m00000102�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x05E3, PID: 0x0610, path: /dev/bus/usb/001/002
�[36m00000094�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
�[36m00000102�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x13D3, PID: 0x56CB, path: /dev/bus/usb/001/003
�[36m00000101�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x13D3, PID: 0x56CB, path: /dev/bus/usb/001/003
�[36m00000100�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x13D3, PID: 0x56CB, path: /dev/bus/usb/001/003
�[36m00000100�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x13D3, PID: 0x56CB, path: /dev/bus/usb/001/003
�[36m00000155�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0003, path: /dev/bus/usb/002/001
�[36m02375426�[0m winscard_msg_srv.c:255:ProcessEventsServer() Common channel packet arrival
�[36m00000015�[0m winscard_msg_srv.c:267:ProcessEventsServer() ProcessCommonChannelRequest detects: 7
�[36m00000004�[0m pcscdaemon.c:133:SVCServiceRunLoop() A new context thread creation is requested: 7
�[36m00000050�[0m winscard_svc.c:340:ContextThread() Authorized PC/SC client
�[36m00000006�[0m winscard_svc.c:344:ContextThread() Thread is started: dwClientID=7, threadContext @0x55b6a0eb3ce0
�[36m00000009�[0m winscard_svc.c:362:ContextThread() Received command: CMD_VERSION from client 7
�[36m00000004�[0m winscard_svc.c:374:ContextThread() Client is protocol version 4:3
�[36m00000003�[0m winscard_svc.c:394:ContextThread() CMD_VERSION rv=0x0 for client 7
�[36m00000030�[0m winscard_svc.c:362:ContextThread() Received command: ESTABLISH_CONTEXT from client 7
�[36m00000007�[0m winscard.c:215:SCardEstablishContext() Establishing Context: 0x42D96134
�[36m00000003�[0m winscard_svc.c:458:ContextThread() ESTABLISH_CONTEXT rv=0x0 for client 7
�[36m00000035�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000033�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m00000023�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000006�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000033�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000050�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000025�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000032�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000021�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001172�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000050�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000260�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000270�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000225�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m00914477�[0m �[34mhotplug_libudev.c:645:HPEstablishUSBNotifications() USB Device removed�[0m
�[36m00085808�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000046�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000169�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000169�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000118�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001491�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000047�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000231�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000243�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000271�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01000849�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000016�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000106�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000106�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000084�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001396�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000047�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000186�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000204�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000156�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m00022779�[0m �[34mhotplug_libudev.c:651:HPEstablishUSBNotifications() USB Device add�[0m
�[36m00000186�[0m hotplug_libudev.c:297:get_driver() Looking for a driver for VID: 0x072F, PID: 0x2224, path: /dev/bus/usb/001/020
�[36m00978506�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000016�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000124�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000065�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000031�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001355�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000046�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000250�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000256�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000222�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001555�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000017�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000068�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000058�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000027�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01000389�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000040�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000076�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000224�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000133�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001418�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000017�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000115�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000065�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000097�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001213�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000047�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000246�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000229�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000182�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001038�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000015�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000104�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000063�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000093�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7
�[36m01001193�[0m winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 7
�[36m00000041�[0m winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 7
�[36m00000209�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000207�[0m winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
�[36m00000231�[0m winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 7

gdb pcscd =>

GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pcscd...Reading symbols from /usr/lib/debug/.build-id/24/5e47e40de4e0b182b0999933c8831eeaa5e365.debug...done.
done.
(gdb)
(gdb)
(gdb)
(gdb)

Install error: cannot find -lpcsclite

I have been trying to install this package without much luck. I've included the error log and a bunch of other information about my setup, i'm not sure how much of it is relevant.

Running

npm install pcsclite --verbose

The interesting part seems to be:

g++ -shared -pthread -rdynamic -m32 -L/usr/lib  -Wl,-soname=pcsclite.node -o Release/obj.target/pcsclite.node -Wl,--start-group Release/obj.target/pcsclite/src/addon.o Release/obj.target/pcsclite/src/pcsclite.o Release/obj.target/pcsclite/src/cardreader.o -Wl,--end-group -lpcsclite
/usr/bin/ld: cannot find -lpcsclite
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/pcsclite.node] Error 1
make: Leaving directory `/fortify/node_modules/pcsclite/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.9.60-linuxkit-aufs
gyp ERR! command "/root/.nvm/versions/node/v8.10.0/bin/node" "/root/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /fortify/node_modules/pcsclite
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

Running

ld -lpcsclite --verbose

I see

attempt to open /usr/x86_64-linux-gnu/lib64/libpcsclite.so failed
attempt to open /usr/x86_64-linux-gnu/lib64/libpcsclite.a failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libpcsclite.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libpcsclite.a failed
attempt to open //usr/local/lib64/libpcsclite.so failed
attempt to open //usr/local/lib64/libpcsclite.a failed
attempt to open //lib/x86_64-linux-gnu/libpcsclite.so failed
attempt to open //lib/x86_64-linux-gnu/libpcsclite.a failed
attempt to open //lib64/libpcsclite.so failed
attempt to open //lib64/libpcsclite.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libpcsclite.so succeeded
-lpcsclite (//usr/lib/x86_64-linux-gnu/libpcsclite.so)
libpthread.so.0 needed by //usr/lib/x86_64-linux-gnu/libpcsclite.so
found libpthread.so.0 at //lib/x86_64-linux-gnu/libpthread.so.0
libc.so.6 needed by //usr/lib/x86_64-linux-gnu/libpcsclite.so
found libc.so.6 at //lib/x86_64-linux-gnu/libc.so.6
ld-linux-x86-64.so.2 needed by //lib/x86_64-linux-gnu/libpthread.so.0
found ld-linux-x86-64.so.2 at //lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
ld: warning: cannot find entry symbol _start; not setting start address

I am running this in a new docker container, running Ubuntu 14.04

The packages installed before running npm install are

apt-get update
apt-get install curl
apt-get install git
apt-get install build-essential
apt-get install python
apt-get install g++-multilib
apt-get install libpcsclite-dev

Node is version 8.10.0
Npm is 5.6.0

PCSC does not find smart card reader

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?

pcscdaemon.c:57:31: fatal error: systemd/sd-daemon.h: No such file or directory

hi,

i am trying to make a arm & mipsel toolchain with pcsc support. when i use the newest version 1.8.23 i get the following error:

CC pcscd-eventhandler.o
CC pcscd-hotplug_generic.o
CC pcscd-ifdwrapper.o
CC pcscd-pcscdaemon.o
pcscdaemon.c:57:31: fatal error: systemd/sd-daemon.h: No such file or directory
#include <systemd/sd-daemon.h>
^
compilation terminated.
Makefile:988: recipe for target 'pcscd-pcscdaemon.o' failed
make[3]: *** [pcscd-pcscdaemon.o] Error 1
make[3]: Leaving directory '/tmp/pcsc-lite-1.8.23/src'
Makefile:1279: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/tmp/pcsc-lite-1.8.23/src'
Makefile:448: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/pcsc-lite-1.8.23'
Makefile:378: recipe for target 'all' failed
make: *** [all] Error 2

but when i use the version before 1.8.22 i dont get this error:

CC pcscd-eventhandler.o
CC pcscd-hotplug_generic.o
CC pcscd-ifdwrapper.o
CC pcscd-pcscdaemon.o
CC pcscd-prothandler.o
CC pcscd-readerfactory.o
CC pcscd-sd-daemon.o
CC pcscd-simclist.o
CC pcscd-sys_unix.o
CC pcscd-tokenparser.o
CC pcscd-hotplug_libudev.o
CC pcscd-hotplug_libusb.o
CC pcscd-hotplug_linux.o
CC pcscd-hotplug_macosx.o
CC pcscd-utils.o

i think this changeset is the problem from 1.8.22 to 1.8.23

1.8.23: Ludovic Rousseau
18 December 2017

use libsystemd instead sd-daemon.{c,h}

is there a way to fix this error?

Unable to list the reader inside docker container.

outside the docker container (it works) and inside docker container it doesn't
apdu4j.ar used is from here

# Listing the readers
rjosyula@qxlsz:~$ java -jar apdu4j.jar -l
[ ] Identiv uTRust 4711 F CL + SAM Reader [uTrust 4711 F SAM Reader] (55651807201207) 00 00
[ ] Identiv uTRust 4711 F CL + SAM Reader [uTrust 4711 F CL Reader] (55651807201207) 01 00
rjosyula@qxlsz:~$ which pcscd
/usr/sbin/pcscd
rjosyula@qxlsz:~$ pcscd -v
pcsc-lite version 1.8.14.
Copyright (C) 1999-2002 by David Corcoran <[email protected]>.
Copyright (C) 2001-2011 by Ludovic Rousseau <[email protected]>.
Copyright (C) 2003-2004 by Damien Sauveron <[email protected]>.
Report bugs to <[email protected]>.
rjosyula@qxlsz:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 04e6:5725 SCM Microsystems, Inc.
Bus 001 Device 004: ID 8087:0aaa Intel Corp.
Bus 001 Device 003: ID 0b05:1872 ASUSTek Computer, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
rjosyula@qxlsz:~$ uname -r
4.15.0-47-generic
rjosyula@qxlsz:~$ dmesg | grep Identiv
[    1.490979] usb 1-2: Product: Identiv uTrust 4711 F CL + SAM Reader
[    1.490980] usb 1-2: Manufacturer: Identiv
[ 1076.766135] usb 1-2: Product: Identiv uTrust 4711 F CL + SAM Reader
[ 1076.766139] usb 1-2: Manufacturer: Identiv
rjosyula@qxlsz:~$ apt list --installed | grep pcsc
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libpcsclite1/xenial-updates,xenial-security,now 1.8.14-1ubuntu1.16.04.1 amd64 [installed]
pcscd/xenial-updates,xenial-security,now 1.8.14-1ubuntu1.16.04.1 amd64 [installed]

Dockerfile looks like this

FROM ubuntu:16.04
# Install Essentials
RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update && apt-get upgrade -y \
    && apt-get install -y --no-install-recommends curl ca-certificates apt-utils\
    && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y git \
            udev \
			software-properties-common\
			autoconf \
			libtool \
			pkg-config \
			libsystemd-dev \
			libudev-dev \
			flex \
			usbutils \
            libpcsclite1 \
            libpcsclite-dev \
            libusb-1.0-0-dev \
            pcscd \
            kmod \ 
            nano \
            linux-headers-`uname -r`
RUN apt-get -y install openjdk-8-jdk
COPY artifacts/* /home/
CMD ["bash"]

Building Dockerfile

docker build  .
Sending build context to Docker daemon  51.27MB
Step 1/7 : FROM ubuntu:16.04
 ---> a3551444fc85
Step 2/7 : RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update && apt-get upgrade -y     && apt-get install -y --no-install-recommends curl ca-certificates apt-utils    && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> d6b506a9e678
Step 3/7 : RUN apt-get update && apt-get install -y git             udev 			software-properties-common			autoconf 			libtool 			pkg-config 			libsystemd-dev 			libudev-dev 			flex 			usbutils             libpcsclite1             libpcsclite-dev             libusb-1.0-0-dev             pcscd             kmod             nano             linux-headers-`uname -r`
 ---> Using cache
 ---> 755d4f82fadf
Step 4/7 : RUN apt-get -y install openjdk-8-jdk
 ---> Using cache
 ---> 6eeea98651aa
Step 5/7 : COPY artifacts/* /home/
 ---> Using cache
 ---> c8c6f79c2939
Step 6/7 : WORKDIR /home/
 ---> Using cache
 ---> 8a2646f06d22
Step 7/7 : CMD ["bash"]
 ---> Using cache
 ---> 59180181e2d9
Successfully built 59180181e2d9

Ran docker using this command

rjosyula@qxlsz:~$ docker run -it --privileged 59180181e2d9
root@59180181e2d9:/home#

Now trying to list readers inside the container. But failing miserably. Not sure what am i doing wrong. please help!

root@59180181e2d9:/home# uname -a
Linux 59180181e2d9 4.15.0-47-generic #50~16.04.1-Ubuntu SMP Fri Mar 15 16:06:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

root@59180181e2d9:/home# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 04e6:5725 SCM Microsystems, Inc.
Bus 001 Device 004: ID 8087:0aaa Intel Corp.
Bus 001 Device 003: ID 0b05:1872 ASUSTek Computer, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@59180181e2d9:/home# which pcscd
/usr/sbin/pcscd

root@59180181e2d9:/home# pcscd -version
pcsc-lite version 1.8.14.
Copyright (C) 1999-2002 by David Corcoran <[email protected]>.
Copyright (C) 2001-2011 by Ludovic Rousseau <[email protected]>.
Copyright (C) 2003-2004 by Damien Sauveron <[email protected]>.
Report bugs to <[email protected]>.
Enabled features: Linux x86_64-pc-linux-gnu serial usb libudev usbdropdir=/usr/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/etc/reader.conf.d

root@59180181e2d9:/home# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  18236  3192 pts/0    Ss   19:23   0:00 bash
root        25  0.0  0.0  34424  2724 pts/0    R+   19:26   0:00 ps aux

root@59180181e2d9:/home# pcscd

root@59180181e2d9:/home# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  18236  3192 pts/0    Ss   19:23   0:00 bash
root        28  0.0  0.0  19240  1668 pts/0    Sl   19:26   0:00 pcscd
root        30  0.0  0.0  34424  2844 pts/0    R+   19:26   0:00 ps aux

root@59180181e2d9:/home# java -jar apdu4j.jar -l
No readers found

root@59180181e2d9:/home# dmesg | grep Identiv
[    1.490979] usb 1-2: Product: Identiv uTrust 4711 F CL + SAM Reader
[    1.490980] usb 1-2: Manufacturer: Identiv
[ 1076.766135] usb 1-2: Product: Identiv uTrust 4711 F CL + SAM Reader
[ 1076.766139] usb 1-2: Manufacturer: Identiv
root@59180181e2d9:/home#
root@59180181e2d9:/home# java -jar apdu4j.jar -ldv
# Using jnasmartcardio.Smartcardio - JNA2PCSC version 0.2
# sun.security.smartcardio.library=/lib/x86_64-linux-gnu/libpcsclite.so.1
# Found 0 terminals
No readers found
root@59180181e2d9:/home#

let me know if you need more information .
Thanks

Broadcom 0a5c:5832 error messages

After my report at https://bugs.launchpad.net/ubuntu/+source/pcsc-lite/+bug/1596662 that the broadcom 0a5c:5832 was working after the firmware update, but I had some kernel messages, I've now tested after a clean install of Ubuntu 16.10+CCID(git HEAD)+PCSC(git HEAD):

When pcscd starts:

00000000 ifdhandler.c:144:CreateChannelByNameOrChannel() failed
00000018 readerfactory.c:1110:RFInitializeReader() Open Port 0x200000 Failed (usb:0a5c/5832:libudev:0:/dev/bus/usb/001/005)
00000004 readerfactory.c:375:RFAddReader() Broadcom Corp 5880 Broadcom USH init failed.

When I read anything from a card:

kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?

Following the log with pcscd --debug and the kernel messages in-line:

:36 pcscd[2811]: 04370016 winscard_msg_srv.c:251:ProcessEventsServer() Common channel packet arrival
:36 pcscd[2811]: 00000035 winscard_msg_srv.c:263:ProcessEventsServer() ProcessCommonChannelRequest detects: 14
:36 pcscd[2811]: 00000006 pcscdaemon.c:132:SVCServiceRunLoop() A new context thread creation is requested: 14
:36 pcscd[2811]: 00000962 winscard_svc.c:329:ContextThread() Authorized PC/SC client
:36 pcscd[2811]: 00000017 winscard_svc.c:333:ContextThread() Thread is started: dwClientID=14, threadContext @0x55590883be80
:36 pcscd[2811]: 00000015 winscard_svc.c:351:ContextThread() Received command: CMD_VERSION from client 14
:36 pcscd[2811]: 00000008 winscard_svc.c:363:ContextThread() Client is protocol version 4:3
:36 pcscd[2811]: 00000005 winscard_svc.c:383:ContextThread() CMD_VERSION rv=0x0 for client 14
:36 pcscd[2811]: 00000141 winscard_svc.c:351:ContextThread() Received command: ESTABLISH_CONTEXT from client 14
:36 pcscd[2811]: 00000019 winscard.c:215:SCardEstablishContext() Establishing Context: 0x12149BCA
:36 pcscd[2811]: 00000005 winscard_svc.c:444:ContextThread() ESTABLISH_CONTEXT rv=0x0 for client 14
:36 pcscd[2811]: 00000105 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000138 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000123 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000084 winscard_svc.c:351:ContextThread() Received command: CONNECT from client 14
:36 pcscd[2811]: 00000012 winscard_svc.c:482:ContextThread() Authorized client for 'Broadcom Corp 5880 Contacted SmartCard 00 00'
:36 pcscd[2811]: 00000006 winscard.c:256:SCardConnect() Attempting Connect to Broadcom Corp 5880 Contacted SmartCard 00 00 using protocol: 3
:36 pcscd[2811]: 00000006 readerfactory.c:825:RFReaderInfo() RefReader() count was: 1
:36 pcscd[2811]: 00002961 ifdhandler.c:1151:IFDHPowerICC() action: PowerUp, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00045796 winscard.c:329:SCardConnect() power up complete.
:36 pcscd[2811]: 00000035 Card ATR: 3B 7D 95 00 00 80 31 80 65 B0 83 11 00 C8 83 00 90 00
:36 pcscd[2811]: 00000008 winscard.c:349:SCardConnect() powerState: POWER_STATE_INUSE
:36 pcscd[2811]: 00000007 prothandler.c:108:PHSetProtocol() Attempting PTS to T=0
:36 pcscd[2811]: 00000009 ifdhandler.c:689:IFDHSetProtocolParameters() protocol T=0, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000008 ifdhandler.c:2078:extra_egt() Extra EGT patch applied
:36 pcscd[2811]: 00031850 winscard.c:428:SCardConnect() Active Protocol: T=0
:36 pcscd[2811]: 00000028 winscard.c:453:SCardConnect() hCard Identity: 23918606
:36 pcscd[2811]: 00000009 winscard.c:517:SCardConnect() UnrefReader() count was: 2
:36 pcscd[2811]: 00000017 winscard_svc.c:496:ContextThread() CONNECT rv=0x0 for client 14
:36 pcscd[2811]: 00000081 winscard_svc.c:351:ContextThread() Received command: CONTROL from client 14
:36 pcscd[2811]: 00000013 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000007 ifdhandler.c:1408:IFDHControl() ControlCode: 0x42000D48, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000003 Control TxBuffer:
:36 pcscd[2811]: 00000014 Control RxBuffer: 12 04 42 33 00 12
:36 pcscd[2811]: 00000005 winscard.c:1369:SCardControl() UnrefReader() count was: 2
:36 pcscd[2811]: 00000004 winscard_svc.c:705:ContextThread() CONTROL rv=0x0 for client 14
:36 pcscd[2811]: 00000047 winscard_svc.c:351:ContextThread() Received command: CONTROL from client 14
:36 pcscd[2811]: 00000011 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 ifdhandler.c:1408:IFDHControl() ControlCode: 0x42330012, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000003 Control TxBuffer:
:36 pcscd[2811]: 00000010 Control RxBuffer: 01 02 00 00 03 01 00 09 01 00 0B 02 5C 0A 0C 02 32 58 0A 04 00 00 01 00
:36 pcscd[2811]: 00000004 winscard.c:1369:SCardControl() UnrefReader() count was: 2
:36 pcscd[2811]: 00000004 winscard_svc.c:705:ContextThread() CONTROL rv=0x0 for client 14
:36 pcscd[2811]: 00000051 winscard_svc.c:351:ContextThread() Received command: CONTROL from client 14
:36 pcscd[2811]: 00000010 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 ifdhandler.c:1408:IFDHControl() ControlCode: 0x42330012, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000003 Control TxBuffer:
:36 pcscd[2811]: 00000010 Control RxBuffer: 01 02 00 00 03 01 00 09 01 00 0B 02 5C 0A 0C 02 32 58 0A 04 00 00 01 00
:36 pcscd[2811]: 00000004 winscard.c:1369:SCardControl() UnrefReader() count was: 2
:36 pcscd[2811]: 00000003 winscard_svc.c:705:ContextThread() CONTROL rv=0x0 for client 14
:36 pcscd[2811]: 00000043 winscard_svc.c:351:ContextThread() Received command: GET_ATTRIB from client 14
:36 pcscd[2811]: 00000011 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 ifdhandler.c:379:IFDHGetCapabilities() tag: 0x10100, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000005 winscard.c:1444:SCardGetAttrib() UnrefReader() count was: 2
:36 pcscd[2811]: 00000004 winscard_svc.c:734:ContextThread() GET_ATTRIB rv=0x0 for client 14
:36 pcscd[2811]: 00000040 winscard_svc.c:351:ContextThread() Received command: GET_ATTRIB from client 14
:36 pcscd[2811]: 00000010 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000004 ifdhandler.c:379:IFDHGetCapabilities() tag: 0x10102, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000004 winscard.c:1444:SCardGetAttrib() UnrefReader() count was: 2
:36 pcscd[2811]: 00000004 winscard_svc.c:734:ContextThread() GET_ATTRIB rv=0x0 for client 14
:36 pcscd[2811]: 00000034 winscard_svc.c:351:ContextThread() Received command: DISCONNECT from client 14
:36 pcscd[2811]: 00000010 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000004 winscard.c:877:SCardDisconnect() Active Contexts: 1
:36 pcscd[2811]: 00000004 winscard.c:878:SCardDisconnect() dwDisposition: 0
:36 pcscd[2811]: 00000006 winscard.c:1024:SCardDisconnect() powerState: POWER_STATE_GRACE_PERIOD
:36 pcscd[2811]: 00000004 ifdhandler.c:379:IFDHGetCapabilities() tag: 0xFB2, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000004 winscard.c:1037:SCardDisconnect() Stopping polling thread
:36 pcscd[2811]: 00000004 ifdhandler.c:344:IFDHStopPolling() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000101 winscard.c:1050:SCardDisconnect() UnrefReader() count was: 2
:36 pcscd[2811]: 00000006 winscard_svc.c:533:ContextThread() DISCONNECT rv=0x0 for client 14
:36 pcscd[2811]: 00000046 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000048 winscard_svc.c:351:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 14
:36 pcscd[2811]: 00000025 winscard_svc.c:351:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 14
:36 pcscd[2811]: 00000012 winscard_svc.c:425:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 14
:36 pcscd[2811]: 00000028 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000054 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000031 winscard_svc.c:351:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 14
:36 pcscd[2811]: 00000016 winscard_svc.c:351:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 14
:36 pcscd[2811]: 00000010 winscard_svc.c:425:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 14
:36 pcscd[2811]: 00000027 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000037 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000029 winscard_svc.c:351:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 14
:36 pcscd[2811]: 00000016 winscard_svc.c:351:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 14
:36 pcscd[2811]: 00000008 winscard_svc.c:425:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 14
:36 pcscd[2811]: 00000030 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
:36 pcscd[2811]: 00000037 winscard_svc.c:351:ContextThread() Received command: CONNECT from client 14
:36 pcscd[2811]: 00000010 winscard_svc.c:482:ContextThread() Authorized client for 'Broadcom Corp 5880 Contacted SmartCard 00 00'
:36 pcscd[2811]: 00000005 winscard.c:256:SCardConnect() Attempting Connect to Broadcom Corp 5880 Contacted SmartCard 00 00 using protocol: 3
:36 pcscd[2811]: 00000004 readerfactory.c:825:RFReaderInfo() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:349:SCardConnect() powerState: POWER_STATE_INUSE
:36 pcscd[2811]: 00000004 winscard.c:428:SCardConnect() Active Protocol: T=0
:36 pcscd[2811]: 00000004 winscard.c:453:SCardConnect() hCard Identity: 1676ca03
:36 pcscd[2811]: 00000004 winscard.c:517:SCardConnect() UnrefReader() count was: 2
:36 pcscd[2811]: 00000005 winscard_svc.c:496:ContextThread() CONNECT rv=0x0 for client 14
:36 pcscd[2811]: 00000039 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000014 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00043859 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000020 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000162 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000024 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000007 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000007 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00016711 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000134 winscard_svc.c:351:ContextThread() Received command: BEGIN_TRANSACTION from client 14
:36 pcscd[2811]: 00000019 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000007 winscard.c:1089:SCardBeginTransaction() Status: 0x00000000
:36 pcscd[2811]: 00000004 winscard.c:1092:SCardBeginTransaction() UnrefReader() count was: 2
:36 pcscd[2811]: 00000005 winscard_svc.c:548:ContextThread() BEGIN_TRANSACTION rv=0x0 for client 14
:36 pcscd[2811]: 00000119 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000030 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000016 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000008 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00008940 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000127 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000024 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00021553 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000121 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000024 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000008 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00007634 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000124 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000023 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00022513 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000069 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000018 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00007655 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000015 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000083 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000016 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000005 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00030911 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000120 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000024 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000009 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00021514 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000018 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000071 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000021 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000007 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000008 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00008024 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000020 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000162 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000024 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00031359 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000019 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000130 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000024 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000007 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00021939 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000067 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000020 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000008 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000009 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00007848 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000118 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000024 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00040816 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000015 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000130 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000018 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000007 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00022590 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000024 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000172 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000026 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000007 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00007383 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000025 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000199 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000026 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000008 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00042192 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000017 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000196 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000016 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00021558 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000015 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000139 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000023 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00007026 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000016 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000144 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000024 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000006 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00052279 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000020 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000210 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000021 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00003950 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00021458 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000024 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000100 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000018 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000007 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00008503 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000020 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000148 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000023 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000007 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00055815 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000024 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000188 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000023 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000006 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000009 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00024867 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000027 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000280 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000026 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000007 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000013 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00012655 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000020 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000133 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000020 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000007 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000009 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00012618 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000010 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000080 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 14
:36 pcscd[2811]: 00000012 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1605:SCardTransmit() Send Protocol: T=0
:36 pcscd[2811]: 00000004 ifdhandler.c:1300:IFDHTransmitToICC() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 kernel: xhci_hcd 0000:00:14.0: WARN Event TRB for slot 5 ep 4 with no TDs queued?
:36 pcscd[2811]: 00012896 winscard.c:1650:SCardTransmit() UnrefReader() count was: 2
:36 pcscd[2811]: 00000011 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 14
:36 pcscd[2811]: 00000159 winscard_svc.c:351:ContextThread() Received command: END_TRANSACTION from client 14
:36 pcscd[2811]: 00000010 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:1244:SCardEndTransaction() Status: 0x00000000
:36 pcscd[2811]: 00000004 winscard.c:1247:SCardEndTransaction() UnrefReader() count was: 2
:36 pcscd[2811]: 00000004 winscard_svc.c:564:ContextThread() END_TRANSACTION rv=0x0 for client 14
:36 pcscd[2811]: 00008796 winscard_svc.c:351:ContextThread() Received command: DISCONNECT from client 14
:36 pcscd[2811]: 00000012 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
:36 pcscd[2811]: 00000005 winscard.c:877:SCardDisconnect() Active Contexts: 1
:36 pcscd[2811]: 00000003 winscard.c:878:SCardDisconnect() dwDisposition: 1
:36 pcscd[2811]: 00004097 ifdhandler.c:1151:IFDHPowerICC() action: Reset, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00045359 winscard.c:932:SCardDisconnect() Reset complete.
:36 pcscd[2811]: 00000017 Card ATR: 3B 7D 95 00 00 80 31 80 65 B0 83 11 00 C8 83 00 90 00
:36 pcscd[2811]: 00000006 winscard.c:1024:SCardDisconnect() powerState: POWER_STATE_GRACE_PERIOD
:36 pcscd[2811]: 00000006 ifdhandler.c:379:IFDHGetCapabilities() tag: 0xFB2, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000003 winscard.c:1037:SCardDisconnect() Stopping polling thread
:36 pcscd[2811]: 00000004 ifdhandler.c:344:IFDHStopPolling() usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:36 pcscd[2811]: 00000095 winscard.c:1050:SCardDisconnect() UnrefReader() count was: 2
:36 pcscd[2811]: 00000008 winscard_svc.c:533:ContextThread() DISCONNECT rv=0x0 for client 14
:36 pcscd[2811]: 00000116 winscard_svc.c:351:ContextThread() Received command: RELEASE_CONTEXT from client 14
:36 pcscd[2811]: 00000009 winscard.c:226:SCardReleaseContext() Releasing Context: 0x12149BCA
:36 pcscd[2811]: 00000006 winscard_svc.c:459:ContextThread() RELEASE_CONTEXT rv=0x0 for client 14
:36 pcscd[2811]: 00000097 winscard_svc.c:343:ContextThread() Client die: 14
:36 pcscd[2811]: 00000020 winscard_svc.c:986:MSGCleanupClient() Thread is stopping: dwClientID=14, threadContext @0x55590883be80
:36 pcscd[2811]: 00000005 winscard_svc.c:992:MSGCleanupClient() Freeing SCONTEXT @0x55590883be80
:36 pcscd[2811]: 00000005 winscard_svc.c:1007:MSGCleanupClient() Starting suicide alarm in 60 seconds
:37 pcscd[2811]: 00399977 eventhandler.c:491:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
:42 pcscd[2811]: 05008011 ifdhandler.c:1151:IFDHPowerICC() action: PowerDown, usb:0a5c/5832:libudev:1:/dev/bus/usb/001/005 (lun: 0)
:42 pcscd[2811]: 00000472 eventhandler.c:479:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED

feitian epass2003 is not working with pcsc-lite 1.8.21 after pcscd restart on freebsd 11

if a start of the pcscd process occurs during the solicitation of the fetian key, the communication becomes impossible with the Token without a hard reboot.

here is a way to reproduce the bug:

#=======================================================
echo ">>>> run pcscd in debug mode:"
LIBCCID_ifdLogLevel=0x000F pcscd --foreground --debug --apdu --color &
#pcscd -dfa &

if [ "$1" == "init" ]; then
echo ">>>> RAZ token"
#box_init_token -f
/usr/local/bin/pkcs15-init --erase-card
/usr/local/bin/pkcs15-init --create-pkcs15 --profile pkcs15+onepin --use-default-transport-key --label "TOKEN" --pin 0000 --puk 1111
fi

echo ">>>> Generate-key"

pkcs15-init --generate-key rsa/2048 --id 3 --auth-id 1 --key-usage sign,decrypt --label "KEY" --pin 0000 & {
sleep 2; #wait for generate to begin
echo '>>>> kill pcscd !!!!'; pkill pcscd ;
}

sleep 1

echo ">>>> Restart pcscd..."
LIBCCID_ifdLogLevel=0x000F pcscd --foreground --debug --apdu --color &

echo ">>>> Try to get serial"
opensc-tool --serial
sleep 3

echo ">>>> Finally kill pcscd"
pkill pcscd
#=======================================================

traces_pcscd_pb.txt

pcscd - apache - NOT authorized for action: access_pcsc

After upgrading from Fedora 25 to F26 /var/log/messages started getting a pair of these lines 1-2 times a minute:

2017-09-21T10:54:35+02:00 ninja pcscd[2721]: 03445385 auth.c:137:IsClientAuthorized() Process 48952 (user: 48) is NOT authorized for action: access_pcsc
2017-09-21T10:54:35+02:00 ninja pcscd[2721]: 00000279 winscard_svc.c:335:ContextThread() Rejected unauthorized PC/SC client

User 48 is apache. I never saw these messages before the upgrade and I wonder what apache possibly could want with pcsc?

Any ideas what could be causing this?

Version: pcsc-lite.x86_64 1.8.22-1.fc26

Cannot work with usb token after removing and inserting

Hi. I plug-in usb token and pcscd works properly.
But if I remove token and wait several seconds and then insert it back. It is not initialized.
I've got this in system log:

pcscd[12373]: 00000065 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 617 
pcscd[12373]: 01000677 eventhandler.c:334:EHStatusHandlerThread() Error communicating to:
XXXXXXXXXXXXXX
pcscd[12373]: 00400502 ccid_usb.c:849:WriteUSB() write failed (1/2): -4 LIBUSB_ERROR_NO_DEVICE
pcscd[12373]: 00000096 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 617
pcscd[12373]: 01000733 eventhandler.c:334:EHStatusHandlerThread() Error communicating to:
XXXXXXXXXXXXXX
pcscd[12373]: 00400553 ccid_usb.c:849:WriteUSB() write failed (1/2): -4 LIBUSB_ERROR_NO_DEVICE
pcscd[12373]: 00000094 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 617 
pcscd[12373]: 01000713 eventhandler.c:334:EHStatusHandlerThread() Error communicating to:
XXXXXXXXXXXXXX
pcscd[12373]: 00400646 ccid_usb.c:849:WriteUSB() write failed (1/2): -4 LIBUSB_ERROR_NO_DEVICE
pcscd[12373]: 00000093 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 617
pcscd[12373]: 01000373 eventhandler.c:334:EHStatusHandlerThread() Error communicating to:
XXXXXXXXXXXXXX
pcscd[12373]: 00400425 ccid_usb.c:849:WriteUSB() write failed (1/2): -4 LIBUSB_ERROR_NO_DEVICE
pcscd[12373]: 00000090 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 617

Could you... may be point the direction of investigation this issue. I've looked at source code, why the thread that serves connection doesn't die or exit, when libusb returns -4 (LIBUSB_ERROR_NO_DEVICE) May be it's a bug?
Thanks in advance

Connect to smart card reader problem with Php

I am trying to run PCSC PHP code that you write but I am getting error. I got the code from your website.

Warning: scard_list_readers() expects parameter 1 to be resource, boolean given in /var/www/html/pcsc.php on line 8
Using reader:
Warning: scard_connect() expects parameter 1 to be resource, boolean given in /var/www/html/pcsc.php on line 16
Warning: scard_release_context() expects parameter 1 to be resource, boolean given in /var/www/html/pcsc.php on line 31

I do not know how to solve these problems.

libusb errors and timeouts

Hi there.
I'm experiencing errors with smartcards and pcscd. By logging pcscd's output I get the following:

# pcscd -f
00000000 ccid_usb.c:1322:InterruptRead() libusb_submit_transfer failed: LIBUSB_ERROR_IO
00003713 ccid_usb.c:898:ReadUSB() read failed (1/23): -1 LIBUSB_ERROR_IO
00000128 ccid_usb.c:898:ReadUSB() read failed (1/23): -1 LIBUSB_ERROR_IO
00000078 ccid_usb.c:898:ReadUSB() read failed (1/23): -1 LIBUSB_ERROR_IO
00000007 ifdhandler.c:194:CreateChannelByNameOrChannel() failed
00009846 /var/tmp/portage/sys-apps/pcsc-lite-1.8.24/work/pcsc-lite-1.8.24/src/readerfactory.c:1106:RFInitializeReader() Open Port 0x200000 Failed (usb:08e6/3438:libudev:0:/dev/bus/usb/001/023)
00000018 /var/tmp/portage/sys-apps/pcsc-lite-1.8.24/work/pcsc-lite-1.8.24/src/readerfactory.c:376:RFAddReader() Gemalto USB Shell Token V2 (A89D8D56) init failed.
00000060 /var/tmp/portage/sys-apps/pcsc-lite-1.8.24/work/pcsc-lite-1.8.24/src/hotplug_libudev.c:523:HPAddDevice() Failed adding USB device: Gemalto USB Shell Token V2
99999999 ccid_usb.c:1322:InterruptRead() libusb_submit_transfer failed: LIBUSB_ERROR_IO
00000090 ccid_usb.c:898:ReadUSB() read failed (1/24): -1 LIBUSB_ERROR_IO
05000226 ccid_usb.c:859:WriteUSB() write failed (1/24): -7 LIBUSB_ERROR_TIMEOUT
05000202 ccid_usb.c:859:WriteUSB() write failed (1/24): -7 LIBUSB_ERROR_TIMEOUT
00000034 ifdhandler.c:194:CreateChannelByNameOrChannel() failed
00001818 /var/tmp/portage/sys-apps/pcsc-lite-1.8.24/work/pcsc-lite-1.8.24/src/readerfactory.c:1106:RFInitializeReader() Open Port 0x200000 Failed (usb:234b/0000:libudev:0:/dev/bus/usb/001/024)
00000014 /var/tmp/portage/sys-apps/pcsc-lite-1.8.24/work/pcsc-lite-1.8.24/src/readerfactory.c:376:RFAddReader() Free
Software Initiative of Japan Gnuk (FSIJ-1.2.8-87133535) init failed.
00000054 /var/tmp/portage/sys-apps/pcsc-lite-1.8.24/work/pcsc-lite-1.8.24/src/hotplug_libudev.c:523:HPAddDevice() Failed adding USB device: Free Software Initiative of Japan Gnuk

As you see, I've tried with two different smartcards. Other normal USB devices work well, there's just an issue with pcscd and GnuPG smartcards.

Can you help me solve this? Thanks!

[Question] Are multiple sockets possible?

I vaguely remember reading your blog many moons ago using an env variable to
basically tell pcscd to use multiple sockets. But I cannot seem to located information on
this now

The irony is I am working on a project where something like multiple sockets would be a great
thing. So I thought I would post this real quick to get an answer.

Can pcscd use multiple sockets? if not, no worries.

Command too long (265 bytes) for max: 261 bytes

Hi,

I am facing issue while using smartcard-hsm on omnikey (3121) Reader.

Details:

**smart card used = smart card hsm
smart card reader = OMNIKEY cardman 3121
OS = Ubuntu 14.04 LTS
opensc/pcsc/ccid installed using apt-get command

opensc version 0.13

smartcard hsm supports Extended APDU and OMNIKEY reader works with proprietary drivers only. However, following error occurs when i use ccid drivers.**

/var/log/syslog given below

PCSC-logs logs shows below.

ay 26 10:26:34 Ubuntu pcscd: commands.c:1661:CmdXfrBlockTPDU_T0() Command too long (265 bytes) for max: 261 bytes
May 26 10:26:34 Ubuntu pcscd: ifdwrapper.c:527:IFDTransmit() Card not transacted: 612
May 26 10:26:34 Ubuntu pcscd: winscard.c:1612:SCardTransmit() Card not transacted: 0x80100016


Due to failure of above command, following error occurred in the stronswan logs.

May 26 10:26:34 Ubuntu charon: 01[LIB] C_Sign() failed: GENERAL_ERROR
May 26 10:26:34 Ubuntu charon: 01[IKE] authentication of 'CN=device1, OU=strongswan' (myself) with RSA signature failed
May 26 10:26:34 Ubuntu charon: 01[IKE] IKE_SA test[1] state change: CONNECTING => DESTROYING
May 26 10:27:03 Ubuntu charon: 14[JOB] deleting half open IKE_SA after timeout
May 26 10:27:03 Ubuntu charon: 14[IKE] IKE_SA (unnamed)[2] state change: CONNECTING => DESTROYING
May 26 10:27:03 Ubuntu charon: 00[DMN] signal of type SIGINT received. Shutting down
May 26 10:27:03 Ubuntu kernel: [ 3346.345859] netlink: 24 bytes leftover after parsing attributes in process `ip'.
-------------------------------------------------------------------------------------

Please guide and help

move pcsc-spy file from HOME

I'd like to see an option to put pcsc-spy file in other path than $HOME.
I mean the file created by the pcsc-spy command

udev and systemd merger

According to the linux-hotplug mailing list, udev and systemd have merged: http://lwn.net/Articles/490413/

When udev support isn't found, the pcsc-lite configure script suggests the following options:
install libudev-dev or use --disable-libudev

I think due to the merger libudev-dev is no longer available??

At least on the Pulsar Linux distribution I'm using, libudev-dev is not available through the so-called smart package manager. After discovering that udev and system have merged, I tried installing the package systemd-dev and was able to build and successfully use pcsc-lite + ccid. (But perhaps it was many of the dependencies installed by systemd-dev that did the trick?)

So I think the suggestions in the configure script should be updated to something like:
install libudev-dev (or systemd-dev* for systems with systemd >= 184) or use --disable-libudev

If that's correct, I can commit a pull request if you like.

Or perhaps the configure script can look for either option? (I'm not a configure script expert.)

*Though on other distributions the package might be named libsystemd-dev or systemd-devel.

v1.8.21 and higher break pcsc-cyberjack driver

Since v1.8.21 it is not possible to establish a "pace (pin)" channel to German eID card with the driver of ReinerSCT cyberjack komfort/standard. [1]

After git bisect this changeset seems to be the reason: 09cf6c7

The problem is the change from "ctStr.cbRecvLength" to "sizeof pbRecvBuffer" as the driver returns 612 (IFD_COMMUNICATION_ERROR) now.

The provided user buffer seems not the problem as it is broken before that check and we do not get a SCARD_E_INSUFFICIENT_BUFFER. If I manually set unsigned char pbRecvBuffer[MAX_BUFFER_SIZE_EXTENDED]; to e.g. 16000 instead of 65548 it will work again.

pcscd log

00000021 winscard_svc.c:679:ContextThread() TRANSMIT rv=0x0 for client 16
00010931 winscard_svc.c:359:ContextThread() Received command: CONTROL from client 16
00000022 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
05153028 ifdwrapper.c:482:IFDControl() Card not transacted: 612
00000022 ifdwrapper.c:484:IFDControl() ControlCode: 0x42000DCC BytesReturned: 0
00000164 ifdwrapper.c:369:IFDStatusICC() Card not transacted: 612
00000025 eventhandler.c:333:EHStatusHandlerThread() Error communicating to: REINER SCT cyberJack RFID komfort (9334382841) 00 00
00000002 TxBuffer 02 CC 02 03 15 7F 4C 12 06 09 04 00 7F 00 07 03 01 02 02 53 05 00 05 13 FF 00 00 B2 02 30 82 02 AE 06 0A 04 00 7F 00 07 03 01 03 01 01 A1 16 0C 14 47 6F 76 65 72 6E 69 6B 75 73 20 54 65 73 74 20 44 56 43 41 A2 1A 13 18 68 74 74 70 3A 2F 2F 77 77 77 2E 67 6F 76 65 72 6E 69 6B 75 73 2E 64 65 A3 1A 0C 18 47 6F 76 65 72 6E 69 6B 75 73 20 47 6D 62 48 20 26 20 43 6F 2E 20 4B 47 A4 20 13 1E 68 74 74 70 73 3A 2F 2F 74 65 73 74 2E 67 6F 76 65 72 6E 69 6B 75 73 2D 65 69 64 2E 64 65 A5 82 01 51 0C 82 01 4D 41 6E 73 63 68 72 69 66 74 3A 09 0D 0A 47 6F 76 65 72 6E 69 6B 75 73 20 47 6D 62 48 20 26 20 43 6F 2E 20 4B 47 0D 0A 41 6D 20 46 61 6C 6C 74 75 72 6D 20 39 0D 0A 32 38 33 35 39 20 42 72 65 6D 65 6E 09 0D 0A 0D 0A 45 2D 4D 61 69 6C 2D 41 64 72 65 73 73 65 3A 09 68 62 40 62 6F 73 2D 62 72 65 6D 65 6E 2E 64 65 09 0D 0A 0D 0A 5A 77 65 63 6B 20 64 65 73 20 41 75 73 6C 65 73 65 76 6F 72 67 61 6E 67 73 3A 09 0D 0A 44 65 6D 6F 6E 73 74 72 61 74 69 6F 6E 20 64 65 73 20 65 49 44 2D 53 65 72 76 69 63 65 09 0D 0A 0D 0A 5A 75 73 74 C3 A4 6E 64 69 67 65 20 44 61 74 65 6E 73 63 68 75 74 7A 61 75 66 73 69 63 68 74 3A 09 0D 0A 44 69 65 20 4C 61 6E 64 65 73 62 65 61 75 66 74 72 61 67 74 65 20 66 C3 BC 72 20 44 61 74 65 6E 73 63 68 75 74 7A 20 75 6E 64 20 49 6E 66 6F 72 6D 61 74 69 6F 6E 73 66 72 65 69 68 65 69 74 20 64 65 72 20 46 72 65 69 65 6E 20 48 61 6E 73 65 73 74 61 64 74 20 42 72 65 6D 65 6E 0D 0A 41 72 6E 64 74 73 74 72 61 C3 9F 65 20 31 0D 0A 32 37 35 37 30 20 42 72 65 6D 65 72 68 61 76 65 6E A6 4B 13 49 68 74 74 70 73 3A 2F 2F 74 65 73 74 2E 67 6F 76 65 72 6E 69 6B 75 73 2D 65 69 64 2E 64 65 3A 34 34 33 2F 41 75 74 65 6E 74 2D 44 65 6D 6F 41 70 70 6C 69 63 61 74 69 6F 6E 2F 52 65 63 65 69 76 65 72 53 65 72 76 6C 65 74 A7 81 8B 31 81 88 04 20 48 B1 39 72 35 E5 5E D1 63 F3 28 0B 17 0B 69 65 CE 39 03 3D 9B 0A 83 14 83 47 FC 3F F9 DA F0 D3 04 20 8A C4 AF BF 23 6C BB 8D 30 D2 FB EB 0A D9 90 D1 01 E4 EF AA 7B 4D F4 CE 17 05 13 5E 53 0E 99 3F 04 20 D2 E5 4E 1D 26 FC 5D FC 34 08 60 98 31 BB E4 CF E3 20 43 65 60 48 49 E7 B0 94 62 35 66 B5 4A 76 04 20 E2 24 D2 5B 44 8D C0 54 C0 23 39 2C A1 10 17 75 10 41 D7 62 F8 3D 88 08 95 B3 01 8D 8E C2 B2 90 
00000085 RxBuffer 
00000012 winscard.c:1369:SCardControl() UnrefReader() count was: 2
00000012 winscard_svc.c:729:ContextThread() CONTROL rv=0x80100016 for client 16
00002469 winscard_svc.c:359:ContextThread() Received command: CMD_GET_READERS_STATE from client 15
00000166 winscard_svc.c:359:ContextThread() Received command: CMD_GET_READERS_STATE from client 7
00397512 ifdwrapper.c:369:IFDStatusICC() Card not transacted: 612
00000021 eventhandler.c:333:EHStatusHandlerThread() Error communicating to: REINER SCT cyberJack RFID komfort (9334382841) 00 00

[1] http://support.reiner-sct.de/downloads/LINUX/V3.99.5_SP11/pcsc-cyberjack-3.99.5final.SP11.tar.bz2

pcscd+rpi+acr122 = error

My Raspberry Pi B can't find reader(ACR122U-A9)

What info I should provide?

root@raspberrypi:/opt# pcscd -daf
00000000 pcscdaemon.c:263:main() pcscd set to foreground with debug send to stdout
00006052 configfile.l:283:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00004974 configfile.l:317:DBGetReaderListDir() Skipping non regular file: .
00003208 configfile.l:317:DBGetReaderListDir() Skipping non regular file: ..
00000160 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00000674 pcscdaemon.c:569:main() pcsc-lite 1.8.13 daemon ready.
00024974 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00007173 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001
00005275 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0424, PID: 0x9512, path: /dev/bus/usb/001/002
00005180 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0424, PID: 0xEC00, path: /dev/bus/usb/001/003
00005289 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0424, PID: 0x9512, path: /dev/bus/usb/001/002

Yubikey 5c Reader "stuck"

PCSC Version: 1.8.24
OS: Arch Linux

For some reason, I can only seem to get my yubikey 5c to be picked up by pcscd once. When it's plugged in after a fresh restart of pcscd, the reader and card show up as expected in pcsc_scan. When it's unplugged, the pcscd log is filled with

Mar 04 12:17:48 atlas pcscd[30090]: 01000205 eventhandler.c:336:EHStatusHandlerThread() Error communicating to: Yubico YubiKey OTP+FIDO+CCID 00 00
Mar 04 12:17:48 atlas pcscd[30090]: 00000110 ccid_usb.c:1322:InterruptRead() libusb_submit_transfer failed: LIBUSB_ERROR_NO_DEVICE
Mar 04 12:17:48 atlas pcscd[30090]: 00400138 ccid_usb.c:859:WriteUSB() write failed (3/2): -4 LIBUSB_ERROR_NO_DEVICE
Mar 04 12:17:48 atlas pcscd[30090]: 00000030 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 617

and the reader sticks around in pcsc_scan with a "status unavailable" card state.

When re-plugging it in, I get

Mar 04 12:19:22 atlas pcscd[30090]: 00594461 ifdhandler.c:150:CreateChannelByNameOrChannel() failed
Mar 04 12:19:22 atlas pcscd[30090]: 00000029 readerfactory.c:1106:RFInitializeReader() Open Port 0x200001 Failed (usb:1050/0407:libudev:0:/dev/bus/usb/003/002)
Mar 04 12:19:22 atlas pcscd[30090]: 00000007 readerfactory.c:376:RFAddReader() Yubico YubiKey OTP+FIDO+CCID init failed.
Mar 04 12:19:22 atlas pcscd[30090]: 00002784 ifdhandler.c:150:CreateChannelByNameOrChannel() failed
Mar 04 12:19:22 atlas pcscd[30090]: 00000018 readerfactory.c:1106:RFInitializeReader() Open Port 0x200001 Failed (usb:1050/0407:libudev:1:/dev/bus/usb/003/002)
Mar 04 12:19:22 atlas pcscd[30090]: 00000005 readerfactory.c:376:RFAddReader() Yubico YubiKey OTP+FIDO+CCID init failed.

and the reader state in pcsc_scan doesn't change.

Re-starting pcscd allows the reader and card to both be picked back up.

In contrast, my several-years-old Yubikey Neo (USB-A) connects and disconnects just fine - both card and reader disappear and re-appear when it's unplugged and plugged back in.

[Question] Max readers limit

Hi Ludovic! First, what a great service!

I was wondering, what is the reason behind the limit of 16 card readers, in both pcsc, and libccid?

Using 'select' in libpcsclite can be problematic for application opening a large number of file descriptors

Hi Ludovic,

Currently, libpcsclite uses select + non-blocking IO when communicating to the PCSC daemon.
However, select can be used only on file descriptors whose value does not exceed FD_SETSIZE. Quote from Linux man page for select:

fd_set is a fixed size buffer. Executing FD_CLR() or FD_SET() with a value of fd that is negative or is equal to or larger than FD_SETSIZE will result in undefined behavior.

More often that not, this undefined behavior will come in the form of a stack corruption.

This means that an application which uses libpcsclite is forced to have no more than FD_SETSIZE (1024) open file descriptors at any given moment. Depending on the use-case this limit can be problematic for the application.

There are other I/O event notification mechanisms which do not have this limitation:
poll, epoll on Linux, kqueue on Mac and BSD, IO completion ports on Windows, etc
Have you considered using any of the above?

LIBUSB_ERROR_OVERFLOW with built-in Broadcom reader

The built-in smartcard reader of my laptop (“Broadcom Corp 5880”) does not reliably work with PCSC. Unpredictably, it is sometimes not recognized by PCSC.

The error code is LIBUSB_ERROR_OVERFLOW. Below is the log from journalctl --unit=pcscd after starting sudo pcscd --foreground --debug. The output is the same whether I have my smartcard (GnuPG v2.1) inserted or not.
log.txt

Looking at the libusb API documentation, I suspect that in readerfactory.c:376:RFAddReader() the buffer length is not set correctly to a multiple of the endpoint’s packet size.

I work in Arch Linux and have the latest versions from the repository:

  • pcsclite: 1.8.23
  • ccid: 1.4.28-1
  • libusb: 1.0.21-2

removing usb token on SunOS results in pcscd getting into an endless loop

Running 1.8.16 on SunOS 5.11
I notice an endless loop after unplugging my gemalto usb token to insert a different one.
Here's the scenario running testpcsc:

richard@omnis:/home/richard/src/pkgsrc/security/pcsc-lite$ pfexec pcscd -f  -d
00000000 debuglog.c:289:DebugLogSetLevel() debug level=debug
00000471 configfile.l:281:DBGetReaderListDir() Parsing conf directory: /opt/local/etc/reader.conf.d
00000098 configfile.l:309:DBGetReaderListDir() Skipping non regular file: .
00000034 configfile.l:309:DBGetReaderListDir() Skipping non regular file: ..
00000066 pcscdaemon.c:567:main() pcsc-lite 1.8.16 daemon ready.
00027142 hotplug_libusb.c:440:HPEstablishUSBNotifications() Driver ifd-ccid.bundle does not support IFD_GENERATE_HOTPLUG. Using active polling instead.
00000034 hotplug_libusb.c:449:HPEstablishUSBNotifications() Polling forced every 1 second(s)
05412558 hotplug_libusb.c:536:HPAddHotPluggable() Adding USB device: 144:2:0
00004375 readerfactory.c:1070:RFInitializeReader() Attempting startup of Gemalto USB Shell Token V2 (AC1366B0) 00 00 using /opt/local/lib/pcsc-lite/drivers/ifd-ccid.bundle/Contents/Solaris/libccid.so
00002432 readerfactory.c:955:RFBindFunctions() Loading IFD Handler 3.0
00000157 ifdhandler.c:1927:init_driver() Driver version: 1.4.20
00001317 ifdhandler.c:1944:init_driver() LogLevel: 0x0003
00000024 ifdhandler.c:1955:init_driver() DriverOptions: 0x0000
00000623 ifdhandler.c:96:CreateChannelByNameOrChannel() Lun: 0, device: usb:08e6/3438:libusb-1.0:144:2:0
00000074 ccid_usb.c:283:OpenUSBByName() Using: /opt/local/lib/pcsc-lite/drivers/ifd-ccid.bundle/Contents/Info.plist
00001174 ccid_usb.c:301:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau ([email protected])
00000024 ccid_usb.c:302:OpenUSBByName() ifdProductString: Generic CCID driver
00000019 ccid_usb.c:303: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.
00021247 ccid_usb.c:595:OpenUSBByName() Found Vendor/Product: 08E6/3438 (Gemalto USB Shell Token V2)
00000066 ccid_usb.c:597:OpenUSBByName() Using USB bus/device: 144/2
00003838 ccid_usb.c:1125:get_data_rates() declared: 12903 bps
00000037 ccid_usb.c:1125:get_data_rates() declared: 25806 bps
00000015 ccid_usb.c:1125:get_data_rates() declared: 51613 bps
00000014 ccid_usb.c:1125:get_data_rates() declared: 103226 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 206452 bps
00000017 ccid_usb.c:1125:get_data_rates() declared: 412903 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 825806 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 154839 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 258065 bps
00000017 ccid_usb.c:1125:get_data_rates() declared: 17204 bps
00000014 ccid_usb.c:1125:get_data_rates() declared: 34409 bps
00000012 ccid_usb.c:1125:get_data_rates() declared: 68817 bps
00000014 ccid_usb.c:1125:get_data_rates() declared: 137634 bps
00000014 ccid_usb.c:1125:get_data_rates() declared: 275269 bps
00000022 ccid_usb.c:1125:get_data_rates() declared: 550538 bps
00000014 ccid_usb.c:1125:get_data_rates() declared: 172043 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 12403 bps
00000014 ccid_usb.c:1125:get_data_rates() declared: 24806 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 49612 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 99225 bps
00000015 ccid_usb.c:1125:get_data_rates() declared: 198450 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 396899 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 74419 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 124031 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 86022 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 38710 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 64516 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 10323 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 20645 bps
00000012 ccid_usb.c:1125:get_data_rates() declared: 41290 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 82581 bps
00000012 ccid_usb.c:1125:get_data_rates() declared: 165161 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 30968 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 18750 bps
00000012 ccid_usb.c:1125:get_data_rates() declared: 37500 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 75000 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 150000 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 300000 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 600000 bps
00000012 ccid_usb.c:1125:get_data_rates() declared: 112500 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 187500 bps
00000012 ccid_usb.c:1125:get_data_rates() declared: 12500 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 25000 bps
00000012 ccid_usb.c:1125:get_data_rates() declared: 50000 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 100000 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 200000 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 400000 bps
00000014 ccid_usb.c:1125:get_data_rates() declared: 125000 bps
00000016 ccid_usb.c:1125:get_data_rates() declared: 56250 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 93750 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 62500 bps
00000017 ccid_usb.c:1125:get_data_rates() declared: 28125 bps
00000013 ccid_usb.c:1125:get_data_rates() declared: 46875 bps
00139372 commands.c:997:CmdEscapeCheck error on byte 10
00000045 ccid.c:216:set_gemalto_firmware_features() GET_FIRMWARE_FEATURES failed: 612, len=0
00000048 ifdhandler.c:375:IFDHGetCapabilities() tag: 0xFB3, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000021 readerfactory.c:396:RFAddReader() Using the reader polling thread
00003951 ifdhandler.c:375:IFDHGetCapabilities() tag: 0xFAE, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000034 ifdhandler.c:463:IFDHGetCapabilities() Reader supports 1 slot(s)
00007875 ifdhandler.c:1139:IFDHPowerICC() action: PowerUp, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00064158 eventhandler.c:286:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
00000058 Card ATR: 3B 7F 96 00 00 00 31 B8 64 40 F3 85 10 73 94 01 80 82 90 00 
00007769 ifdhandler.c:1139:IFDHPowerICC() action: PowerDown, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00013069 eventhandler.c:479:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED

at this stage I run testpcsc:

richard@omnis:/tmp/pkgsrc/security/pcsc-lite/work/pcsc-lite-1.8.16/src$ ./testpcsc 

MUSCLE PC/SC Lite unitary test Program

THIS PROGRAM IS NOT DESIGNED AS A TESTING TOOL FOR END USERS!
Do NOT use it unless you really know what you do.

Testing SCardEstablishContext   : Command successful.
Testing SCardIsValidContext : Command successful.
Testing SCardIsValidContext : Invalid handle. (don't panic)
Testing SCardListReaderGroups   : Command successful.
Group 01: SCard$DefaultReaders
Testing SCardFreeMemory     : Command successful.
Testing SCardListReaders    : Command successful.
Testing SCardListReaders    : Command successful.
Reader 01: Gemalto USB Shell Token V2 (AC1366B0) 00 00
Waiting for card insertion  : Command successful.
Testing SCardConnect        : Command successful.
Select file: 00 A4 00 00 02 3F 00
Testing SCardTransmit       : Command successful.
 card response: 61 1A
Testing SCardControl        : GemCore USB 3.0 Command successful.
Testing SCardGetAttrib      : Command successful.
SCARD_ATTR_DEVICE_FRIENDLY_NAME: Gemalto USB Shell Token V2 (AC1366B0) 00 00
Testing SCardFreeMemory     : Command successful.
Testing SCardGetAttrib      : Command successful.
SCARD_ATTR_ATR_STRING length: 20
SCARD_ATTR_ATR_STRING: 3B 7F 96 00 00 00 31 B8 64 40 F3 85 10 73 94 01 80 82 90 00 
Testing SCardFreeMemory     : Command successful.
Testing SCardGetAttrib      : Command successful.
Vendor IFD version      : 2.0.0
Testing SCardGetAttrib      : Command successful.
Max message length      : 261
Testing SCardGetAttrib      : Command successful.
Vendor name         : Gemalto
Testing SCardSetAttrib      : Transaction failed. (don't panic)
Testing SCardStatus     : Command successful.
Current Reader Name     : Gemalto USB Shell Token V2 (AC1366B0) 00 00
Current Reader State        : 0x0034
Current Reader Protocol     : T=0
Current Reader ATR Size     : 20 bytes
Current Reader ATR Value    : 3B 7F 96 00 00 00 31 B8 64 40 F3 85 10 73 94 01 80 82 90 00 
Testing SCardFreeMemory     : Command successful.
Testing SCardFreeMemory     : Command successful.
Press enter: 
Testing SCardReconnect      : Command successful.
Testing SCardDisconnect     : Command successful.
Testing SCardFreeMemory     : Command successful.
Testing SCardReleaseContext : Command successful.

PC/SC Test Completed Successfully !

and here is the output from pcscd prior to yanking the usb token:

52432904 winscard_msg_srv.c:251:ProcessEventsServer() Common channel packet arrival
00000146 winscard_msg_srv.c:263:ProcessEventsServer() ProcessCommonChannelRequest detects: 19
00000022 pcscdaemon.c:132:SVCServiceRunLoop() A new context thread creation is requested: 19
00000436 winscard_svc.c:329:ContextThread() Authorized PC/SC client
00000042 winscard_svc.c:333:ContextThread() Thread is started: dwClientID=19, threadContext @8087d50
00000043 winscard_svc.c:351:ContextThread() Received command: CMD_VERSION from client 19
00000043 winscard_svc.c:363:ContextThread() Client is protocol version 4:3
00000017 winscard_svc.c:383:ContextThread() CMD_VERSION rv=0x0 for client 19
00000119 winscard_svc.c:351:ContextThread() Received command: ESTABLISH_CONTEXT from client 19
00000058 winscard.c:213:SCardEstablishContext() Establishing Context: 0x310F
00000018 winscard_svc.c:444:ContextThread() ESTABLISH_CONTEXT rv=0x0 for client 19
00000150 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 19
00000092 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 19
00000111 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 19
00000093 winscard_svc.c:351:ContextThread() Received command: CONNECT from client 19
00000046 winscard_svc.c:482:ContextThread() Authorized client for 'Gemalto USB Shell Token V2 (AC1366B0) 00 00'
00000018 winscard.c:255:SCardConnect() Attempting Connect to Gemalto USB Shell Token V2 (AC1366B0) 00 00 using protocol: 3
00000017 readerfactory.c:826:RFReaderInfo() RefReader() count was: 1
00004166 ifdhandler.c:1139:IFDHPowerICC() action: PowerUp, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00064040 winscard.c:330:SCardConnect() power up complete.
00000049 Card ATR: 3B 7F 96 00 00 00 31 B8 64 40 F3 85 10 73 94 01 80 82 90 00 
00000018 winscard.c:350:SCardConnect() powerState: POWER_STATE_INUSE
00000014 prothandler.c:108:PHSetProtocol() Attempting PTS to T=0
00000016 ifdhandler.c:682:IFDHSetProtocolParameters() protocol T=0, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000044 ifdhandler.c:2047:extra_egt() Extra EGT patch applied
00000022 towitoko/atr.c:357:ATR_GetDefaultProtocol() no default protocol found in ATR. Using T=0
00013775 winscard.c:429:SCardConnect() Active Protocol: T=0
00000031 winscard.c:449:SCardConnect() hCard Identity: 1efe
00000019 winscard.c:510:SCardConnect() UnrefReader() count was: 2
00000017 winscard_svc.c:496:ContextThread() CONNECT rv=0x0 for client 19
00000144 winscard_svc.c:351:ContextThread() Received command: TRANSMIT from client 19
00000039 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000018 winscard.c:1606:SCardTransmit() Send Protocol: T=0
00000018 ifdhandler.c:1283:IFDHTransmitToICC() usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00038843 winscard.c:1651:SCardTransmit() UnrefReader() count was: 2
00000048 winscard_svc.c:661:ContextThread() TRANSMIT rv=0x0 for client 19
00000151 winscard_svc.c:351:ContextThread() Received command: CONTROL from client 19
00000036 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000018 ifdhandler.c:1377:IFDHControl() ControlCode: 0x42000001, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000025 Control TxBuffer: 02 
00003631 Control RxBuffer: 47 65 6D 43 6F 72 65 20 55 53 42 20 33 2E 30 
00000030 winscard.c:1370:SCardControl() UnrefReader() count was: 2
00000015 winscard_svc.c:705:ContextThread() CONTROL rv=0x0 for client 19
00000127 winscard_svc.c:351:ContextThread() Received command: GET_ATTRIB from client 19
00000028 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000019 ifdhandler.c:375:IFDHGetCapabilities() tag: 0x7FFF0003, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000015 winscard.c:1445:SCardGetAttrib() UnrefReader() count was: 2
00000013 winscard_svc.c:734:ContextThread() GET_ATTRIB rv=0x0 for client 19
00000116 winscard_svc.c:351:ContextThread() Received command: GET_ATTRIB from client 19
00000025 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000016 ifdhandler.c:375:IFDHGetCapabilities() tag: 0x90303, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000015 winscard.c:1445:SCardGetAttrib() UnrefReader() count was: 2
00000014 winscard_svc.c:734:ContextThread() GET_ATTRIB rv=0x0 for client 19
00000136 winscard_svc.c:351:ContextThread() Received command: GET_ATTRIB from client 19
00000023 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000015 ifdhandler.c:375:IFDHGetCapabilities() tag: 0x10102, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000015 winscard.c:1445:SCardGetAttrib() UnrefReader() count was: 2
00000013 winscard_svc.c:734:ContextThread() GET_ATTRIB rv=0x0 for client 19
00000104 winscard_svc.c:351:ContextThread() Received command: GET_ATTRIB from client 19
00000024 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000015 ifdhandler.c:375:IFDHGetCapabilities() tag: 0x7A007, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000014 winscard.c:1445:SCardGetAttrib() UnrefReader() count was: 2
00000013 winscard_svc.c:734:ContextThread() GET_ATTRIB rv=0x0 for client 19
00000100 winscard_svc.c:351:ContextThread() Received command: GET_ATTRIB from client 19
00000024 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000015 ifdhandler.c:375:IFDHGetCapabilities() tag: 0x10100, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000033 winscard.c:1445:SCardGetAttrib() UnrefReader() count was: 2
00000015 winscard_svc.c:734:ContextThread() GET_ATTRIB rv=0x0 for client 19
00000105 winscard_svc.c:351:ContextThread() Received command: SET_ATTRIB from client 19
00000024 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000016 ifdhandler.c:639:IFDHSetCapabilities() tag: 0x90303, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000013 winscard.c:1495:SCardSetAttrib() UnrefReader() count was: 2
00000013 winscard_svc.c:754:ContextThread() SET_ATTRIB rv=0x80100016 for client 19
00000099 winscard_svc.c:351:ContextThread() Received command: CMD_GET_READERS_STATE from client 19
00000087 winscard_svc.c:351:ContextThread() Received command: STATUS from client 19
00000030 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000013 winscard.c:1311:SCardStatus() UnrefReader() count was: 2
00000013 winscard_svc.c:608:ContextThread() STATUS rv=0x0 for client 19
02810347 winscard_svc.c:351:ContextThread() Received command: RECONNECT from client 19
00000041 winscard.c:524:SCardReconnect() Attempting reconnect to token.
00000013 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00004424 ifdhandler.c:1139:IFDHPowerICC() action: PowerDown, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00018006 ifdhandler.c:1139:IFDHPowerICC() action: PowerUp, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00064070 winscard.c:604:SCardReconnect() Reset complete.
00000046 Card ATR: 3B 7F 96 00 00 00 31 B8 64 40 F3 85 10 73 94 01 80 82 90 00 
00000020 prothandler.c:108:PHSetProtocol() Attempting PTS to T=0
00000017 ifdhandler.c:682:IFDHSetProtocolParameters() protocol T=0, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000018 ifdhandler.c:2047:extra_egt() Extra EGT patch applied
00000015 towitoko/atr.c:357:ATR_GetDefaultProtocol() no default protocol found in ATR. Using T=0
00013824 winscard.c:723:SCardReconnect() Active Protocol: T=0
00000037 winscard.c:813:SCardReconnect() UnrefReader() count was: 2
00000016 winscard_svc.c:515:ContextThread() RECONNECT rv=0x0 for client 19
00000144 winscard_svc.c:351:ContextThread() Received command: DISCONNECT from client 19
00000029 readerfactory.c:853:RFReaderInfoById() RefReader() count was: 1
00000015 winscard.c:870:SCardDisconnect() Active Contexts: 1
00000014 winscard.c:871:SCardDisconnect() dwDisposition: 2
00003728 ifdhandler.c:1139:IFDHPowerICC() action: PowerDown, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00016983 ifdhandler.c:1139:IFDHPowerICC() action: PowerUp, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00064102 winscard.c:937:SCardDisconnect() Reset complete.
00000051 Card ATR: 3B 7F 96 00 00 00 31 B8 64 40 F3 85 10 73 94 01 80 82 90 00 
00000021 winscard.c:1036:SCardDisconnect() powerState: POWER_STATE_GRACE_PERIOD
00000016 ifdhandler.c:375:IFDHGetCapabilities() tag: 0xFB2, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000016 winscard.c:1050:SCardDisconnect() Stopping polling thread
00000015 ifdhandler.c:340:IFDHStopPolling() usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00000065 winscard.c:1063:SCardDisconnect() UnrefReader() count was: 2
00000045 winscard_svc.c:533:ContextThread() DISCONNECT rv=0x0 for client 19
00000200 winscard_svc.c:351:ContextThread() Received command: RELEASE_CONTEXT from client 19
00000025 winscard.c:224:SCardReleaseContext() Releasing Context: 0x310F
00000017 winscard_svc.c:459:ContextThread() RELEASE_CONTEXT rv=0x0 for client 19
00000111 winscard_svc.c:343:ContextThread() Client die: 19
00000082 winscard_svc.c:986:MSGCleanupClient() Thread is stopping: dwClientID=19, threadContext @8087d50
00000039 winscard_svc.c:992:MSGCleanupClient() Freeing SCONTEXT @8087d50
00001330 eventhandler.c:491:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
00007827 ifdhandler.c:1139:IFDHPowerICC() action: PowerDown, usb:08e6/3438:libusb-1.0:144:2:0 (lun: 0)
00013051 eventhandler.c:479:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED

then pulling the plug:

99999999 commands.c:1211:CmdGetSlotStatus() Not enough data received: 0 bytes
00000047 ifdwrapper.c:369:IFDStatusICC() Card not transacted: 612
00000014 eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Gemalto USB Shell Token V2 (AC1366B0) 00 00
00000673 commands.c:1211:CmdGetSlotStatus() Not enough data received: 0 bytes
00000021 ifdwrapper.c:369:IFDStatusICC() Card not transacted: 612
00000012 eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Gemalto USB Shell Token V2 (AC1366B0) 00 00
00000461 commands.c:1211:CmdGetSlotStatus() Not enough data received: 0 bytes
00000020 ifdwrapper.c:369:IFDStatusICC() Card not transacted: 612
00000012 eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Gemalto USB Shell Token V2 (AC1366B0) 00 00
00000440 commands.c:1211:CmdGetSlotStatus() Not enough data received: 0 bytes
00000020 ifdwrapper.c:369:IFDStatusICC() Card not transacted: 612
00000012 eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Gemalto USB Shell Token V2 (AC1366B0) 00 00
00000445 commands.c:1211:CmdGetSlotStatus() Not enough data received: 0 bytes

which loops until I

This is using recently libusb-1 support for SunOS... I must say setting LIBUSB_DEBUG=4
is quite noisy...
This is the output between two sets of above:

00030711 commands.c:1211:CmdGetSlotStatus() Not enough data received: 0 bytes
00000018 ifdwrapper.c:369:IFDStatusICC() Card not transacted: 612
00000014 eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Gemalto USB Shell Token V2 00 00
[100.921341] [ffffffff] libusb: debug [libusb_alloc_transfer] transfer 80898a8
[100.921354] [ffffffff] libusb: debug [libusb_submit_transfer] transfer 80898a8
[100.921369] [ffffffff] libusb: debug [sunos_clock_gettime] clock 0
[100.921383] [ffffffff] libusb: debug [add_to_flying_list] arm timerfd for timeout in 600000ms (first in line)
[100.921399] [ffffffff] libusb: debug [sunos_check_device_and_status_open] open ep 0x81
[100.921411] [ffffffff] libusb: debug [sunos_check_device_and_status_open] ep 0x81 already opened, return success
[100.921425] [ffffffff] libusb: debug [sunos_submit_transfer] INTR transfer: 8
[100.921438] [ffffffff] libusb: debug [sunos_do_async_io] 
[100.921466] [ffffffff] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[100.921483] [ffffffff] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
[100.921579] [ffffffff] libusb: debug [sunos_usb_get_status] sunos_usb_get_status(): fd=13
[100.921603] [ffffffff] libusb: debug [sunos_usb_get_status] Device was Disconnected

data dump:
[100.921630] [ffffffff] libusb: debug [sunos_async_callback] ret=19, len=8, actual_len=0
[100.921664] [ffffffff] libusb: debug [handle_events] poll() returned 1
[100.921681] [ffffffff] libusb: debug [handle_events] caught a fish on the event pipe
[100.921694] [ffffffff] libusb: debug [disarm_timerfd] 
[100.921709] [ffffffff] libusb: debug [usbi_handle_transfer_completion] transfer 80898a8 has callback fec7d530
[100.921725] [ffffffff] libusb: debug [libusb_free_transfer] transfer 80898a8
[100.921743] [ffffffff] libusb: debug [libusb_alloc_transfer] transfer 80898a8
[100.921753] [ffffffff] libusb: debug [libusb_submit_transfer] transfer 80898a8
[100.921763] [ffffffff] libusb: debug [sunos_clock_gettime] clock 0
[100.921774] [ffffffff] libusb: debug [add_to_flying_list] arm timerfd for timeout in 5000ms (first in line)
[100.921787] [ffffffff] libusb: debug [sunos_check_device_and_status_open] open ep 0x02
[100.921798] [ffffffff] libusb: debug [sunos_check_device_and_status_open] ep 0x02 already opened, return success
[100.921809] [ffffffff] libusb: debug [sunos_submit_transfer] BULK transfer: 10
[100.921821] [ffffffff] libusb: debug [sunos_do_async_io] 
[100.921841] [ffffffff] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[100.921851] [ffffffff] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
[100.921942] [ffffffff] libusb: debug [sunos_usb_get_status] sunos_usb_get_status(): fd=16
[100.921963] [ffffffff] libusb: debug [sunos_usb_get_status] Device was Disconnected

data dump:
[100.947763] [ffffffff] libusb: debug [sunos_async_callback] ret=19, len=10, actual_len=0
[100.942020] [ffffffff] libusb: debug [libusb_get_device_list] 
[100.922221] [ffffffff] libusb: debug [handle_events] poll() returned 1
[100.947860] [ffffffff] libusb: debug [handle_events] timerfd triggered
[100.947875] [ffffffff] libusb: debug [sunos_clock_gettime] clock 0
[100.947889] [ffffffff] libusb: debug [arm_timerfd_for_next_timeout] next timeout originally 5000ms
[100.947913] [ffffffff] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms
[100.947935] [ffffffff] libusb: debug [handle_events] poll() returned 1
[100.947948] [ffffffff] libusb: debug [handle_events] caught a fish on the event pipe
[100.954280] [ffffffff] libusb: debug [disarm_timerfd] 
[100.954310] [ffffffff] libusb: debug [usbi_handle_transfer_completion] transfer 80898a8 has callback fef5a970
[100.954319] [ffffffff] libusb: debug [sync_transfer_cb] actual_length=0
[100.954332] [ffffffff] libusb: debug [libusb_free_transfer] transfer 80898a8
[100.954346] [ffffffff] libusb: debug [libusb_alloc_transfer] transfer 8089530
[100.954356] [ffffffff] libusb: debug [libusb_submit_transfer] transfer 8089530
[100.954366] [ffffffff] libusb: debug [sunos_clock_gettime] clock 0
[100.954374] [ffffffff] libusb: debug [add_to_flying_list] arm timerfd for timeout in 3000ms (first in line)
[100.954385] [ffffffff] libusb: debug [sunos_check_device_and_status_open] open ep 0x82
[100.954394] [ffffffff] libusb: debug [sunos_check_device_and_status_open] ep 0x82 already opened, return success
[100.954407] [ffffffff] libusb: debug [sunos_submit_transfer] BULK transfer: 10
[100.954417] [ffffffff] libusb: debug [sunos_do_async_io] 
[100.954441] [ffffffff] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[100.954449] [ffffffff] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
[100.954562] [ffffffff] libusb: debug [sunos_usb_get_status] sunos_usb_get_status(): fd=18
[100.954606] [ffffffff] libusb: debug [sunos_usb_get_status] Device was Disconnected

data dump:
[100.954638] [ffffffff] libusb: debug [sunos_async_callback] ret=19, len=10, actual_len=0
[100.954671] [ffffffff] libusb: debug [handle_events] poll() returned 1
[100.954683] [ffffffff] libusb: debug [handle_events] caught a fish on the event pipe
[100.954692] [ffffffff] libusb: debug [disarm_timerfd] 
[100.954702] [ffffffff] libusb: debug [usbi_handle_transfer_completion] transfer 8089530 has callback fef5a970
[100.954711] [ffffffff] libusb: debug [sync_transfer_cb] actual_length=0
[100.954727] [ffffffff] libusb: debug [libusb_free_transfer] transfer 8089530
00033412 commands.c:1211:CmdGetSlotStatus() Not enough data received: 0 bytes
00000012 ifdwrapper.c:369:IFDStatusICC() Card not transacted: 612
00000009 eventhandler.c:333:EHStatusHandlerThread() Error communicating to: Gemalto USB Shell Token V2 00 00

CardConnection transmit error while generating RSA Keys longer than 64 bytes (SAM)

Hello,

I'm trying to generate a RSA key pair using a SAM (Secure Access Module), I followed all instructions from the documentation, but if I try to generate keys larger than 64 bytes (i.e. 128/256 bytes) I get a weird error related to the PCSC driver.

This is the most detailed stack trace that I could get, using cyberflex:

<class 'smartcard.Exceptions.CardConnectionException'>: Failed to transmit with protocol T1. Transaction failed.
  File "/home/cyberflex-shell/shell.py", line 126, in _run
    self.parse_and_execute(line)
  File "cyberflex-shell.py", line 309, in parse_and_execute
    result = Shell.parse_and_execute(self, line)
  File "/home/cyberflex-shell/shell.py", line 201, in parse_and_execute
    return function(*args)
  File "cyberflex-shell.py", line 244, in do_fancy_apdu
    return self.do_apdu(apdu)
  File "cyberflex-shell.py", line 267, in do_apdu
    response = self.card.send_apdu(apdu)
  File "/home/cyberflex-shell/cards/generic_card.py", line 173, in send_apdu
    result = self._send_with_retry(apdu)
  File "/home/cyberflex-shell/cards/iso_card.py", line 130, in _send_with_retry
    result = self._real_send(apdu)
  File "/home/cyberflex-shell/cards/iso_card.py", line 122, in _real_send
    result = Card._real_send(self, apdu)
  File "/home/cyberflex-shell/cards/generic_card.py", line 138, in _real_send
    result_binary = self.reader.transceive(apdu_binary)
  File "/home/cyberflex-shell/readers.py", line 115, in transceive
    data, sw1, sw2 = self._cardservice.connection.transmit(data_bytes, protocol=self.PROTOMAP[self.get_protocol()])
  File "/usr/local/lib/python2.7/dist-packages/smartcard/CardConnectionDecorator.py", line 82, in transmit
    return self.component.transmit(bytes, protocol)
  File "/usr/local/lib/python2.7/dist-packages/smartcard/CardConnection.py", line 146, in transmit
    data, sw1, sw2 = self.doTransmit(bytes, protocol)
  File "/usr/local/lib/python2.7/dist-packages/smartcard/pcsc/PCSCCardConnection.py", line 205, in doTransmit
    SCardGetErrorMessage(hresult))

Also, in the docs they said that this C-APDU execution takes a while (1 minute or so, for longer keys), when I tried generating 64 byte keys or less it didn't took as much (barely 1 or 2 seconds), but when generating larger keys it starts computing for about 3-5 seconds, and then this error happens. I thought that maybe there was a timer/timeout callback, but couldn't find anything related, even so, maybe that extra bit of information helps.

Thanks in advance!

pcsc-lite fails to build on ChomeOS:

I am trying to compile pcsc on ChromeOS using libusb with disabled libudev, however, I get:
error: cannot find the library '/usr/local/lib/libudev.la'

I configured:

./configure --disable-libudev --disable-libsystemd --enable-libusb --enable-ipcdir=/usr/local/var/run/pcscd --enable-confdir=/usr/local/etc/reader.conf.d --enable-static=yes --prefix=/usr/local
hotplug_libusb.c: In function ‘HPAddHotPluggable.isra.0’:
hotplug_libusb.c:599:47: warning: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 126 [-Wformat-truncation=]
     snprintf(fullname, sizeof(fullname), "%s (%s)",
                                               ^~
      driver->readerName, serialNumber);
                          ~~~~~~~~~~~~          
hotplug_libusb.c:599:5: note: ‘snprintf’ output 4 or more bytes (assuming 131) into a destination of size 128
     snprintf(fullname, sizeof(fullname), "%s (%s)",
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      driver->readerName, serialNumber);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       pcscd-hotplug_linux.o
  CC       pcscd-hotplug_macosx.o
  CC       pcscd-utils.o
  CC       pcscd-winscard.o
  CC       pcscd-winscard_msg.o
  CC       pcscd-winscard_msg_srv.o
  CC       pcscd-winscard_svc.o
  CCLD     pcscd
libtool:   error: cannot find the library '/usr/local/lib/libudev.la' or unhandled argument '/usr/local/lib/libudev.la'
make[3]: *** [Makefile:757: pcscd] Error 1
make[3]: Leaving directory '/usr/local/tmp/crew/PCSC/src'
make[2]: *** [Makefile:1314: all-recursive] Error 1
make[2]: Leaving directory '/usr/local/tmp/crew/PCSC/src'
make[1]: *** [Makefile:447: all-recursive] Error 1
make[1]: Leaving directory '/usr/local/tmp/crew/PCSC'
make: *** [Makefile:377: all] Error 2

Old card reader ACR-120S with serial port does not work with pcsc-lite 1.8.13

  • OS: Debian 8.11 i386
  • pcsc-lite version: 1.8.13
  • Device: ACR-120 S
  • Driver: ACS Synchronous API Drivers (Proprietary Drivers) 1.1.1

Driver installed and him files exist in paths:

  • /usr/include/ACR120.h
  • /usr/lib/libACR120.so
  • /usr/lib/libACR120.so.1
  • /usr/lib/libACR120.so.1.1.1

I tried differently to configure the config, but without a positive result.

/etc/reader.conf.d/acr120s

FRIENDLYNAME "ACR-120 S"
#DEVICENAME /dev/ttyS0  # I read this not for old drivers
LIBPATH /usr/lib/libACR120.so.1.1.1  # I tried and others *so files
CHANNELID 1  # This for old drivers. I sorted variants from 0 to 5.

Restart PCSC daemon include errors of device initialization:

сен 17 16:35:18 test systemd[1]: Started PC/SC Smart Card Daemon.
сен 17 16:35:18 test pcscd[7940]: ****** acsr2032 ****** ACR120 Proprietary Library [Linux DLL] built on [Apr 13 2006][16:41:27] loaded @_@
сен 17 16:35:18 test pcscd[7940]: ****** acsr2032 ****** SysConfigInit(0xBFCB09A0, [ACR120.conf]) entered
сен 17 16:35:18 test pcscd[7940]: ****** acsr2032 ****** SysConfigInit: open [/etc/ACR120.conf] failed(2)[No such file or directory]
сен 17 16:35:18 test pcscd[7940]: ****** acsr2032 ****** DllSystemInit: SysConfigInit [ACR120.conf] failed(0x1)
сен 17 16:35:18 test pcscd[7940]: ****** acsr2032 ****** DllSystemInit: [Default] DebugSetLevels(0-99.1)
сен 17 16:35:18 test pcscd[7940]: 00000000 dyn_unix.c:106:DYN_GetAddress() IFDHCreateChannel: /usr/lib/libACR120.so.1.1.1: undefined symbol: IFDHCreateChannel
сен 17 16:35:18 test pcscd[7940]: 00000089 readerfactory.c:841:RFBindFunctions() IFDHandler functions missing
сен 17 16:35:18 test pcscd[7940]: 00000025 readerfactory.c:1028:RFInitializeReader() RFBindFunctions failed: 0x80100014
сен 17 16:35:18 test pcscd[7940]: 00000123 readerfactory.c:335:RFAddReader() ACR-120 S init failed.

Device released in 2005, last official driver released in 13.04.2006.

I will be glad to any help.

Thanks.

UPDATED

sudo LIBCCID_ifdLogLevel=0x000F pcscd --foreground --debug --apdu --color | tee log.txt

Full log:

00000000 debuglog.c:292:DebugLogSetLevel() debug level=debug
00006944 debuglog.c:321:DebugLogSetCategory() Debug options: APDU
00000652 pcscdaemon.c:268:main() Force colored logs
00001093 configfile.l:283:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00000551 configfile.l:317:DBGetReaderListDir() Skipping non regular file: .
00000398 configfile.l:317:DBGetReaderListDir() Skipping non regular file: ..
00000360 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/acr120s
00000613 configfile.l:212:evaluatetoken() Add reader: ACR-120 S
00004437 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/libccidtwin
00000753 readerfactory.c:1012:RFInitializeReader() Attempting startup of ACR-120 S 00 00 using /usr/lib/libACR120.so.1.1.1
00004873 dyn_unix.c:106:DYN_GetAddress() IFDHCreateChannelByName: /usr/lib/libACR120.so.1.1.1: undefined symbol: IFDHCreateChannelByName
00003981 dyn_unix.c:106:DYN_GetAddress() IFDHCreateChannel: /usr/lib/libACR120.so.1.1.1: undefined symbol: IFDHCreateChannel
00000490 readerfactory.c:841:RFBindFunctions() IFDHandler functions missing
00000375 readerfactory.c:1028:RFInitializeReader() RFBindFunctions failed: 0x80100014
00000356 readerfactory.c:934:RFUnloadReader() Unloading reader driver.
00000496 readerfactory.c:335:RFAddReader() ACR-120 S init failed.
00000423 pcscdaemon.c:569:main() pcsc-lite 1.8.13 daemon ready.
00035259 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/002/001
00005547 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/002/001
00001196 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0BF8, PID: 0x1004, path: /dev/bus/usb/002/002
00001132 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0BF8, PID: 0x1004, path: /dev/bus/usb/002/002
00005843 hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0002, path: /dev/bus/usb/001/001

Make pcsc-spy python3-ready

Using FreeBSD 12.0-CURRENT with Python3 as default python, I noticed that the amount of changes to pcsc-spy for adding python3 compatibility are quite trivial.

  1. Use parentheses around all print statements
  2. Queue becomes queue, so this would work:
try:
    from Queue import Queue
except ImportError:
    from queue import Queue

That's it really.

Smart card reader is not accessiable

Hi,
I am facing an issue while using SmartCard-HSM on a Linux machine. I am using smartcard with strongswan for VPN based on certificates. I am trying to check the presence of smart card by using command "pkcs15-tool -D" in bash/perl script and included in crontab but it fails after some time.

after 30 sec i got following messages in the logs.
first it gave "PKCS#15 binding failed:"

Using reader with a card: Gemalto GemPC Twin 00 00
PKCS#15 binding failed: Transmit failed

After another 30 sec the command output was "Failed to connect to card:"
Using reader with a card: Gemalto GemPC Twin 00 00
Failed to connect to card: Generic reader error

Other partial logs information is following, detail logs are attached;
A Part from OPENSC log, during this test i did not unplugged smart cards

0x77b5b210 10:28:40.440 [pkcs15-tool] reader-pcsc.c:376:refresh_attributes: card absent

A Part from PCSCD log

05000157 ccid_usb.c:638:WriteUSB() write failed (3/8): -7 Success

Another part from PCSCD log

00000012 ifdhandler.c:1292:IFDHTransmitToICC() usb:08e6/3437:libusb-1.0:3:8:0 (lun: 0)
00000008 openct/proto-t1.c:170:t1_transceive() T=1 state machine is DEAD. Reset the card first.
00000005 ifdwrapper.c:520:IFDTransmit() Card not transacted: 612
00000005 winscard.c:1564:SCardTransmit() Card not transacted: 0x80100016

I have already posted the same issue on OPENSC list. The details of the problem, logs and packages are given on following OPENSC link;

https://github.com/OpenSC/OpenSC/issues/976

OPENSC final comments were following;

It is not clear what is going on. PCSC reporting 0x80100016 SCARD_E_NOT_TRANSACTED
starting at 10:24:19.810 in the logs implies there is a problem with the card, reader or USB.

On your blog https://ludovicrousseau.blogspot.com/2010/05/how-to-know-pin-sizes-supported-by.html I found following;

The application has no way to know why the command failed. Someone has to look at the very low level logs to discover that the probelm is with wPINMaxExtraDigit.

Can we get information about the cause of the problem after looking on the PCSCD logs, can you suggest the solution after having detail look on PCSCD logs attached, please.

Packages details are following;

kernel 3.10
strongswan 5.3
libusb 1.0.8-1
pcsc-lite 1.8.1-1
ccid 1.4.5
opensc 0.15.0-1
libtool 2.4.2
smart cards Cardomatic HSM
Gemalto SC reader

Link to detail logs logs.tar.gz

Statically (or minimal dynamically) linked build for an initramfs

Is there a way of statically linking pcsc-lite (and I suppose CCID also)?

If not, how would you recommend building both of these in order to minimise the number and size of shared library dependencies?

I am asking because I want to include pcsc-lite and CCID in an initramfs in order to make a smartcard available in the early boot process.

Many Thanks

Build pcscd error

Hi Ludovic

I do build pcscd and found some error:
root@ubuntu:/opt/software/pcscd/PCSC# ./configure CC=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-gcc --host=arm-fsl-linux prefix=/usr/ccid --enable-libusb LIBUSB_LIBS="-L/usr/ccid/install/lib -lusb-1.0" LIBUSB_CFLAGS="-I/usr/ccid/install/include/libusb-1.0" PCSC_CFLAGS="-I/usr/ccid/include/PCSC" PCSC_LIBS="-L/usr/ccid/lib/ -lpcsclite" --enable-usbdropdir="/usr/ccid/lib/pcsc/drivers" --enable-static --disable-libudev --disable-libsystemd

After, do make, got below error:
root@ubuntu:/opt/software/pcscd/PCSC# make
make all-recursive
make[1]: Entering directory /opt/software/pcscd/PCSC' Making all in src make[2]: Entering directory /opt/software/pcscd/PCSC/src'
Making all in spy
make[3]: Entering directory /opt/software/pcscd/PCSC/src/spy' make[3]: Nothing to be done for all'.
make[3]: Leaving directory /opt/software/pcscd/PCSC/src/spy' make[3]: Entering directory /opt/software/pcscd/PCSC/src'
CCLD pcsc-wirecheck
pcsc-wirecheck-main.o: In function main': /opt/software/pcscd/PCSC/src/pcsc-wirecheck-main.c:12: undefined reference to pcsc_assert_wire_constants'
collect2: ld returned 1 exit status
make[3]: *** [pcsc-wirecheck] Error 1
make[3]: Leaving directory /opt/software/pcscd/PCSC/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory /opt/software/pcscd/PCSC/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/software/pcscd/PCSC'
make: *** [all] Error 2
root@ubuntu:/opt/software/pcscd/PCSC#

I do comment that line, then can build successful

There have two issues:

  1. Build got /opt/software/pcscd/PCSC/src/pcsc-wirecheck-main.c:12: undefined reference to `pcsc_assert_wire_constants'
  2. Download package from release, build give configfile.c missing

CCID unknown when updating file in smartcard (extended APDU)

When performing an update on a file with a 32Kb APDU, the following error is shown on pcscd logs:

...
pcscd[14964]: 00000000 commands.c:1523:CCID_Receive Unknown CCID error: 0xC3
pcscd[14964]: 00000029 ifdwrapper.c:543:IFDTransmit() Card not transacted: 612
pcscd[14964]: 00000006 winscard.c:1626:SCardTransmit() Card not transacted: 0x80100016
...

I'm using the following reader:

Reader 0: ACS ACR1252 Dual Reader [ACR1252 Dual Reader PICC] 00 00

And the card capabilities are as follows:

  Tag: 7, len: 3 (card capabilities)
  Selection methods: 84
    - DF selection by full DF name
    - Short EF identifier supported
  Data coding byte: 01
    - Behaviour of write functions: one-time write
    - Value 'FF' for the first byte of BER-TLV tag fields: invalid
    - Data unit in quartets: 2
  Command chaining, length fields and logical channels: E0
    - Command chaining
    - Extended Lc and Le fields
    - RFU (should not happen)
    - Logical channel number assignment: No logical channel
    - Maximum number of logical channels: 1

Which means the card supports extended APDUs. I also have the NFC reader documentation and it supports extended Lc and Le fields.

Is this an issue?

Cheers.

Chicony HP Skylab error in the protocol stream

The same problem like (#48 ccid)
Rdesktop with Athena card and Chicony HP Skylab USB Smartcard Keyboard reader.
Debian stretch amd64 with libccid 1.4.29-2, athena's idprotectclient-633.00
This configuration works properly with two other readers.
With Chicony HP Skylab I've got Windows messages from asepkcs.dll exception code: 0xc0000409, "error in the protocol stream".
Debian syslog:
syslog_1.txt

and termdd:
t1a.txt

t3a.txt

pcsc_scan looks good

Error on Electron windows

Hi guys.
I'm encountering the below error when running electron app on Windows.
I'm using this package ( https://github.com/pokusew/nfc-pcsc ) to connect to an card reader.
Any help would be greatly appreciated!

Uncaught Error: \?\C:\Users\ionutmilas\AppData\Local\Temp\7aeba51b-2fba-46a5-a482-8eb4db26026d.tmp.node is not a valid Win32 application\?\C:\Users\ionutmilas\AppData\Local\Temp\7aeba51b-2fba-46a5-a482-8eb4db26026d.tmp.node
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:671:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:187:18)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at bindings (\mac\Home\Desktop\win-unpacked\resources\app.asar\node_modules\bindings\bindings.js:81:44)
at Object. (\mac\Home\Desktop\win-unpacked\resources\app.asar\node_modules@pokusew\pcsclite\lib\pcsclite.js:4:37)

Smart token debug gdb on pcscd

Hi Ludovic,
I am trying to make a iKey1000 (safenet->now Gemalto) usb token to respond to API. I have its own IFD library loaded ( as module) and all looks fine on PCSCD foreground debug messages.
When I try to open this device it fails (create context is ok) , It is using pcsc-lite library but not supporting standard CCID.
Now I want to debug this once it is detected by udev_hotplug. how to set gdb to put breakpoints to check what this driver is doing ( even in assembly code). Please help me setup debug with pcscd since it is not crashing and backtrace is not available.
I am using PCSC ver 1.8.8 source and then compiled on Centos7 32bit , since device drivers are of 32 bit version.
Please help !!

$ tree /usr/local/lib/pcsc/drivers/rnboifd.bundle/
/usr/local/lib/pcsc/drivers/rnboifd.bundle/
|-- Contents
| |-- Info.plist
| |-- Linux
| | |-- librnboifd.so -> /usr/local/lib/pcsc/drivers/rnboifd.bundle/Contents/Linux/librnboifd.so.1.1.0.8
| | -- librnboifd.so.1.1.0.8 | |-- PkgInfo | -- Resources
| -- English.lproj | -- InfoPlist.strings
|-- license.txt
`-- Readme.txt

$ /usr/local/sbin/pcscd --version
pcsc-lite version 1.8.8.
Copyright (C) 1999-2002 by David Corcoran [email protected].
Copyright (C) 2001-2011 by Ludovic Rousseau [email protected].
Copyright (C) 2003-2004 by Damien Sauveron [email protected].
Report bugs to [email protected].
Enabled features: Linux i686-pc-linux-gnu serial usb libudev usbdropdir=/usr/local/lib/pcsc/drivers debugatr ipcdir=/var/run/pcscd configdir=/usr/local/etc/reader.conf.d

$ sudo gdb /usr/local/sbin/pcscd
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-114.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/local/sbin/pcscd...done.
(gdb) set args --foreground --debug --apdu
(gdb) run
Starting program: /usr/local/sbin/pcscd --foreground --debug --apdu
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
00000000 debuglog.c:269:DebugLogSetLevel() debug level=debug
00000043 debuglog.c:298:DebugLogSetCategory() Debug options: APDU
00001247 configfile.l:298:DBGetReaderList() Parsing conf file: /usr/local/etc/reader.conf.d
00000021 pcscdaemon.c:525:main() pcsc-lite 1.8.8 daemon ready.
00001820 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/001/001
00000152 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/001/001
00000159 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x04B9, PID: 0x1000, path: /dev/bus/usb/001/069
00000032 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x04B9, PID: 0x1000, path: /dev/bus/usb/001/069
00000006 hotplug_libudev.c:312:HPAddDevice() Adding USB device: rainbow
00000045 readerfactory.c:978:RFInitializeReader() Attempting startup of rainbow 00 00 using /usr/local/lib/pcsc/drivers/rnboifd.bundle/Contents/Linux/librnboifd.so
00011185 dyn_unix.c:81:DYN_GetAddress() IFDHCreateChannelByName: /usr/local/lib/pcsc/drivers/rnboifd.bundle/Contents/Linux/librnboifd.so: undefined symbol: IFDHCreateChannelByName
00000022 readerfactory.c:836:RFBindFunctions() Loading IFD Handler 2.0
00000034 readerfactory.c:327:RFAddReader() Using the pcscd polling thread
[New Thread 0xb7c56b40 (LWP 19136)]
[New Thread 0xb7455b40 (LWP 19137)]
[New Thread 0xb6c54b40 (LWP 19138)]
00034770 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010946 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010320 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010355 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011876 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010591 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010747 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011402 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011313 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011361 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011376 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010237 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011334 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011720 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011364 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010923 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011601 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011269 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011366 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011424 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010950 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011468 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010398 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011390 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011203 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011415 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011405 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011382 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011423 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010987 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011446 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010500 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011465 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010954 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011367 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011369 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011409 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011318 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010858 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011380 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010603 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011397 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00019677 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00028661 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00021706 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00015154 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00017322 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00021865 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00015737 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00016566 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00021686 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00015503 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00016964 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00021771 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00015666 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00016730 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00021688 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010880 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011103 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011279 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011330 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00014669 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011375 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011255 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011359 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010679 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010338 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011335 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011339 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011472 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011214 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011364 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011384 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011273 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010217 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011024 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011310 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011455 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011418 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011376 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011429 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011370 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00011044 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010711 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00010326 readerfactory.c:1309:RFWaitForReaderInit() Waiting init for reader: rainbow 00 00
00001145 eventhandler.c:256:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
00000038 Card ATR: 3B 0F 52 4E 42 4F 24 56 23 2E 00 00 00 12 00 58 76
00452681 eventhandler.c:446:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED


$ sudo LIBCCID_ifdLogLevel=0x000F pcscd --foreground --debug --apdu --color | tee log.txt
00000000 debuglog.c:269:DebugLogSetLevel() debug level=debug
00000039 debuglog.c:298:DebugLogSetCategory() Debug options: APDU
00000008 pcscdaemon.c:238:main() Force colored logs
00000781 configfile.l:245:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00000012 configfile.l:257:DBGetReaderListDir() Skipping non regular file: .
00000004 configfile.l:257:DBGetReaderListDir() Skipping non regular file: ..
00000007 pcscdaemon.c:525:main() pcsc-lite 1.8.8 daemon ready.
00023419 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/001/001
00000142 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/001/001
00000141 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x04B9, PID: 0x1000, path: /dev/bus/usb/001/069
00000030 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x04B9, PID: 0x1000, path: /dev/bus/usb/001/069
00000004 hotplug_libudev.c:312:HPAddDevice() Adding USB device: vipinxxrx
00000040 readerfactory.c:978:RFInitializeReader() Attempting startup of vipinxxrx 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00041270 readerfactory.c:868:RFBindFunctions() Loading IFD Handler 3.0
00000084 ifdhandler.c:1842:init_driver() Driver version: 1.4.10
00000842 ifdhandler.c:1859:init_driver() LogLevel: 0x0003
00000010 ifdhandler.c:1870:init_driver() DriverOptions: 0x0000
00000217 ifdhandler.c:1883:init_driver() LogLevel from LIBCCID_ifdLogLevel: 0x000F
00000010 ifdhandler.c:83:CreateChannelByNameOrChannel() Lun: 0, device: usb:04b9/1000:libudev:0:/dev/bus/usb/001/069
00000010 ccid_usb.c:210:OpenUSBByName() Reader index: 0, Device: usb:04b9/1000:libudev:0:/dev/bus/usb/001/069
00000022 ccid_usb.c:242:OpenUSBByName() interface_number: 0
00000005 ccid_usb.c:258:OpenUSBByName() Using: /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
00000658 ccid_usb.c:276:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau ([email protected])
00000010 ccid_usb.c:277:OpenUSBByName() ifdProductString: Generic CCID driver
00000006 ccid_usb.c:278: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.
00003563 ccid_usb.c:405:OpenUSBByName() Checking device: 1/69
00000009 ccid_usb.c:460:OpenUSBByName() Trying to open USB bus/device: 1/69
00000082 ccid_usb.c:855:get_ccid_device_descriptor() Extra field has a wrong length: 2
00000015 ccid_usb.c:518:OpenUSBByName() Unable to find the device descriptor for 1/69
00000241 ccid_usb.c:179:close_libusb_if_needed() libusb_exit
00000502 ifdhandler.c:117:CreateChannelByNameOrChannel() failed
00000012 readerfactory.c:1009:RFInitializeReader() Open Port 0x200000 Failed (usb:04b9/1000:libudev:0:/dev/bus/usb/001/069)
00000005 readerfactory.c:312:RFAddReader() vipinxxrx init failed.
00000007 readerfactory.c:529:RFRemoveReader() UnrefReader() count was: 1
00000006 readerfactory.c:1029:RFUnInitializeReader() Attempting shutdown of vipinxxrx 00 00.
00000005 readerfactory.c:905:RFUnloadReader() Unloading reader driver.
00000056 hotplug_libudev.c:384:HPAddDevice() Failed adding USB device: vipinxxrx

LIBUSB_ERROR_TIMEOUT when I try to read data on Belgian ID card

It works well when I do it on MacOS, but it fails when try it through virtualbox on a fedora. Any idea how to solve this?

$ pcsc_scan 
PC/SC device scanner
V 1.5.2 (c) 2001-2017, Ludovic Rousseau <[email protected]>
Using reader plug'n play mechanism
Scanning present readers...
0: Generic Smart Card Reader Interface [Smart Card Reader Interface] (20070818000000000) 00 00
 
Wed Jul 18 12:47:17 2018
 Reader 0: Generic Smart Card Reader Interface [Smart Card Reader Interface] (20070818000000000) 00 00
  Card state: Card inserted, 
  ATR: 3B 98 13 40 0A A5 03 01 01 01 AD 13 11

ATR: 3B 98 13 40 0A A5 03 01 01 01 AD 13 11
+ TS = 3B --> Direct Convention
+ T0 = 98, Y(1): 1001, K: 8 (historical bytes)
  TA(1) = 13 --> Fi=372, Di=4, 93 cycles/ETU
    43010 bits/s at 4 MHz, fMax for Fi = 5 MHz => 53763 bits/s
  TD(1) = 40 --> Y(i+1) = 0100, Protocol T = 0 
-----
  TC(2) = 0A --> Work waiting time: 960 x 10 x (Fi/F)
+ Historical bytes: A5 03 01 01 01 AD 13 11
  Category indicator byte: A5 (proprietary format)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 98 13 40 0A A5 03 01 01 01 AD 13 11
	Belgium Electronic ID card
$  pkcs15-tool -D

with

$ pcscd --foreground --debug
05048718 ifdhandler.c:1154:IFDHPowerICC() action: PowerDown, usb:0bda/0165:libudev:0:/dev/bus/usb/001/007 (lun: 0)
00133474 eventhandler.c:480:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED
00070424 winscard_msg_srv.c:255:ProcessEventsServer() Common channel packet arrival
00000023 winscard_msg_srv.c:267:ProcessEventsServer() ProcessCommonChannelRequest detects: 14
00000004 pcscdaemon.c:133:SVCServiceRunLoop() A new context thread creation is requested: 14
00005169 winscard_svc.c:340:ContextThread() Authorized PC/SC client
00000461 winscard_svc.c:344:ContextThread() Thread is started: dwClientID=14, threadContext @0x55671ef0f900
00000324 winscard_svc.c:362:ContextThread() Received command: CMD_VERSION from client 14
00000014 winscard_svc.c:374:ContextThread() Client is protocol version 4:3
00000007 winscard_svc.c:394:ContextThread() CMD_VERSION rv=0x0 for client 14
00000388 winscard_svc.c:362:ContextThread() Received command: ESTABLISH_CONTEXT from client 14
00000024 winscard.c:215:SCardEstablishContext() Establishing Context: 0x67F77458
00000188 winscard_svc.c:458:ContextThread() ESTABLISH_CONTEXT rv=0x0 for client 14
00000091 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000188 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000248 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000049 winscard_svc.c:362:ContextThread() Received command: CONNECT from client 14
00003769 winscard_svc.c:496:ContextThread() Authorized client for 'Generic Smart Card Reader Interface [Smart Card Reader Interface] (20070818000000000) 00 00'
00000445 winscard.c:259:SCardConnect() Attempting Connect to Generic Smart Card Reader Interface [Smart Card Reader Interface] (20070818000000000) 00 00 using protocol: 3
00000547 readerfactory.c:821:RFReaderInfo() RefReader() count was: 1
00005008 ifdhandler.c:1154:IFDHPowerICC() action: PowerUp, usb:0bda/0165:libudev:0:/dev/bus/usb/001/007 (lun: 0)
00050126 winscard.c:332:SCardConnect() power up complete.
00000829 Card ATR: 3B 98 13 40 0A A5 03 01 01 01 AD 13 11 
00000337 winscard.c:352:SCardConnect() powerState: POWER_STATE_INUSE
00000456 prothandler.c:108:PHSetProtocol() Attempting PTS to T=0
00000600 ifdhandler.c:695:IFDHSetProtocolParameters() protocol T=0, usb:0bda/0165:libudev:0:/dev/bus/usb/001/007 (lun: 0)
03009450 ccid_usb.c:888:ReadUSB() read failed (1/7): -7 LIBUSB_ERROR_TIMEOUT
00000204 ifdhandler.c:925:IFDHSetProtocolParameters() PPS_Exchange Failed
00000670 prothandler.c:124:PHSetProtocol() PTS failed (605), using T=0
00000325 winscard.c:518:SCardConnect() UnrefReader() count was: 2
00000359 winscard_svc.c:510:ContextThread() CONNECT rv=0x80100066 for client 14
00000639 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000387 winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 14
00000325 winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 14
00000015 winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 14
00000024 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000558 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000054 winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 14
00000013 winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 14
00000009 winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 14
00000016 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000024 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000026 winscard_svc.c:362:ContextThread() Received command: CMD_WAIT_READER_STATE_CHANGE from client 14
00000011 winscard_svc.c:362:ContextThread() Received command: CMD_STOP_WAITING_READER_STATE_CHANGE from client 14
00000007 winscard_svc.c:439:ContextThread() CMD_STOP_WAITING_READER_STATE_CHANGE rv=0x0 for client 14
00000014 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000021 winscard_svc.c:362:ContextThread() Received command: CONNECT from client 14
00005362 winscard_svc.c:496:ContextThread() Authorized client for 'Generic Smart Card Reader Interface [Smart Card Reader Interface] (20070818000000000) 00 00'
00000633 winscard.c:259:SCardConnect() Attempting Connect to Generic Smart Card Reader Interface [Smart Card Reader Interface] (20070818000000000) 00 00 using protocol: 3
00000290 readerfactory.c:821:RFReaderInfo() RefReader() count was: 1
00000421 winscard.c:352:SCardConnect() powerState: POWER_STATE_INUSE
00000413 prothandler.c:108:PHSetProtocol() Attempting PTS to T=0
00000351 ifdhandler.c:695:IFDHSetProtocolParameters() protocol T=0, usb:0bda/0165:libudev:0:/dev/bus/usb/001/007 (lun: 0)
03009473 ccid_usb.c:888:ReadUSB() read failed (1/7): -7 LIBUSB_ERROR_TIMEOUT
00000315 ifdhandler.c:925:IFDHSetProtocolParameters() PPS_Exchange Failed
00000283 prothandler.c:124:PHSetProtocol() PTS failed (605), using T=0
00000270 winscard.c:518:SCardConnect() UnrefReader() count was: 2
00000230 winscard_svc.c:510:ContextThread() CONNECT rv=0x80100066 for client 14
00000749 winscard_svc.c:362:ContextThread() Received command: RELEASE_CONTEXT from client 14
00000437 winscard.c:229:SCardReleaseContext() Releasing Context: 0x67F77458
00000253 winscard_svc.c:473:ContextThread() RELEASE_CONTEXT rv=0x0 for client 14
00001070 winscard_svc.c:354:ContextThread() Client die: 14
00000578 winscard_svc.c:1029:MSGCleanupClient() Thread is stopping: dwClientID=14, threadContext @0x55671ef0f900
00000527 winscard_svc.c:1035:MSGCleanupClient() Freeing SCONTEXT @0x55671ef0f900

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.