LudovicRousseau / pcsc-tools

Some tools to be used with smart cards and PC/SC
https://pcsc-tools.apdu.fr/
GNU General Public License v2.0
195 stars 62 forks source link

SLE 4442 card is unresponsive #46

Closed yuvadm closed 3 years ago

yuvadm commented 3 years ago

There is a specific card I've been using for a long time and has been working flawlessly. A few months ago a regression happened (possibly as a result of a version upgrade?) and the card stopped working.

pcsc_scan detects the card just fine:

$ pcsc_scan 
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR 38U-CCID 00 00

Tue Aug  3 09:32:33 2021
 Reader 0: ACS ACR 38U-CCID 00 00
  Event number: 0
  Card state: Card inserted, 
  ATR: 3B 04 A2 13 10 91

ATR: 3B 04 A2 13 10 91
+ TS = 3B --> Direct Convention
+ T0 = 04, Y(1): 0000, K: 4 (historical bytes)
+ Historical bytes: A2 13 10 91
  Category indicator byte: A2 (proprietary format)

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 04 A2 13 10 91
    PM2P Chipkarte SLE 4442, Code FFFFFF
    Bahn BKK (Deutsche Bahn AG - Insurance Company)
    NH Hotels World fidelization card
    Miele Professional card for paying washing machine
    SLE5542 Memory Card (Other)
    https://www.acs.com.hk/download-manual/6009/TDS_SLE5542.pdf
 /   

But scriptor claims the card is unresponsive:

$ cat read.dat 
FF A4 00 00 01 06
FF B0 00 00 FF

$ scriptor read.dat 
No reader given: using ACS ACR 38U-CCID 00 00
Can't allocate Chipcard::PCSC::Card object: Card is unresponsive.

Running on Arch Linux versions:

$ pacman -Q | grep pcsc
pcsc-perl 1.4.14-12
pcsc-tools 1.5.7-1
pcsclite 1.9.1-1
LudovicRousseau commented 3 years ago

Hello, I need a pcscd log as explained in https://ccid.apdu.fr/#support

yuvadm commented 3 years ago

@LudovicRousseau there you go https://gist.github.com/yuvadm/d4987b9db039d0d42988782245ec5f26

LudovicRousseau commented 3 years ago

Update the CCID driver from version 1.4.34 to 1.4.35 and try again.

yuvadm commented 3 years ago

Upgraded ccid to 1.4.35 - same problem, here's the log for the second run https://gist.github.com/yuvadm/260d79103147909b3fa7a96aec3972de

LudovicRousseau commented 3 years ago

It is a bug in PCSC that is already fixed but not yet released. See https://github.com/LudovicRousseau/PCSC/commit/7730f6c54d7fb6a910d291e2d48c92d2a5abf688

I will provide a snapshot of PCSC so you can test it.

LudovicRousseau commented 3 years ago

Try with this version of pcsc-lite http://ludovic.rousseau.free.fr/softwares/pcsc-lite/pcsc-lite-1.9.1-f94cb5e.tar.bz2

yuvadm commented 3 years ago

Looking much better! I still see commands.c:2336:SetParameters Command not supported or not allowed in the log but there's no failure anymore.

Any idea when a release can be expected?

Thanks @LudovicRousseau !

LudovicRousseau commented 3 years ago

Done https://ludovicrousseau.blogspot.com/2021/08/new-version-of-pcsc-lite-192.html