pcscd doesn't support ActivKEy SIM B/N: 0945423

Bug #1879960 reported by Dejan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcsc-lite (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have ActivKey SIM B/N: 0945423 (from banking authorization) which is not recognized by pcscd. Since it is not recognized, it is also not recognized by VMware Workstation VM which runs Windows. Banking software running in windows doesn't see the key and can't authenticate me.
Few years ago, this was working on Ubuntu 18.04, so it must be something in version between.
After restart of the pcscd service, USB key shows green light, but few seconds after it goes to red.

sudo service pcscd status
● pcscd.service - PC/SC Smart Card Daemon
     Loaded: loaded (/lib/systemd/system/pcscd.service; indirect; vendor preset: enabled)
     Active: active (running) since Thu 2020-05-21 15:47:40 CEST; 24s ago
TriggeredBy: ● pcscd.socket
       Docs: man:pcscd(8)
   Main PID: 230408 (pcscd)
      Tasks: 5 (limit: 57614)
     Memory: 1.9M
     CGroup: /system.slice/pcscd.service
             └─230408 /usr/sbin/pcscd --foreground --auto-exit

svi 21 15:47:40 rodigerlaptop1 systemd[1]: Started PC/SC Smart Card Daemon.
svi 21 15:48:01 rodigerlaptop1 pcscd[230408]: 00000000 ccid_usb.c:857:WriteUSB() write failed (1/12): -4 LIBUSB_ERROR_NO_DEVICE
svi 21 15:48:04 rodigerlaptop1 pcscd[230408]: 02310986 commands.c:249:CmdPowerOn Card absent or mute
svi 21 15:48:04 rodigerlaptop1 pcscd[230408]: 00000264 commands.c:249:CmdPowerOn Card absent or mute
svi 21 15:48:04 rodigerlaptop1 pcscd[230408]: 00000343 commands.c:249:CmdPowerOn Card absent or mute
svi 21 15:48:04 rodigerlaptop1 pcscd[230408]: 00000005 ifdhandler.c:1221:IFDHPowerICC() PowerUp failed
svi 21 15:48:04 rodigerlaptop1 pcscd[230408]: 00000003 eventhandler.c:305:EHStatusHandlerThread() Error powering up card: 2148532246 0x80100016

Result of pcsc_scan
sudo pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
Waiting for the first reader...found one
Scanning present readers...
0: ActivIdentity Activkey_Sim [CCID Bulk Interface] 00 00

Thu May 21 15:44:16 2020
 Reader 0: ActivIdentity Activkey_Sim [CCID Bulk Interface] 00 00
  Event number: 0
  Card state: Card inserted, Unresponsive card,

So USB key is visible

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: pcscd 1.8.26-3
ProcVersionSignature: Ubuntu 5.4.0-31.35-generic 5.4.34
Uname: Linux 5.4.0-31-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Thu May 21 15:38:57 2020
SourcePackage: pcsc-lite
UpgradeStatus: Upgraded to focal on 2020-05-11 (10 days ago)

Revision history for this message
Dejan (dejan-rodiger) wrote :
Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

Please generate a pcscd log.
See https://ccid.apdu.fr/#support

Revision history for this message
Dejan (dejan-rodiger) wrote :

/usr/sbin/pcscd --version
pcsc-lite version 1.8.26.
Copyright (C) 1999-2002 by David Corcoran <email address hidden>.
Copyright (C) 2001-2018 by Ludovic Rousseau <email address hidden>.
Copyright (C) 2003-2004 by Damien Sauveron <email address hidden>.
Report bugs to <email address hidden>.
Enabled features: Linux x86_64-pc-linux-gnu libsystemd serial usb libudev usbdropdir=/usr/lib/pcsc/drivers ipcdir=/run/pcscd filter configdir=/etc/reader.conf.d

uname -a
Linux rodigerlaptop1 5.4.0-31-generic #35-Ubuntu SMP Thu May 7 20:20:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu 20.04

HP Zbook 15 G3 laptop

ActivKey SIM B/N: 0945423
This is USB key

[ 6955.286635] usb 1-1: new full-speed USB device number 7 using xhci_hcd
[ 6955.437171] usb 1-1: New USB device found, idVendor=09c3, idProduct=0014, bcdDevice= 2.07
[ 6955.437172] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 6955.437174] usb 1-1: Product: Activkey_Sim
[ 6955.437174] usb 1-1: Manufacturer: ActivIdentity

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

I don't see any problem in your log.
The card is detected and the ATR is available.
You can test with the command pcsc_scan from the package pcsc-tools.

Please generate a new log including the problem.

Revision history for this message
Dejan (dejan-rodiger) wrote :

sudo service pcscd status
● pcscd.service - PC/SC Smart Card Daemon
     Loaded: loaded (/lib/systemd/system/pcscd.service; indirect; vendor preset: enabled)
     Active: inactive (dead)
TriggeredBy: ● pcscd.socket
       Docs: man:pcscd(8)
drodiger@rodigerlaptop1:~$ sudo pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
0: ActivIdentity Activkey_Sim [CCID Bulk Interface] 00 00

Mon May 25 13:13:00 2020
 Reader 0: ActivIdentity Activkey_Sim [CCID Bulk Interface] 00 00
  Event number: 0
  Card state: Card inserted, Unresponsive card,
Scanning present readers...
Waiting for the first reader...found one
Scanning present readers...
0: ActivIdentity Activkey_Sim [CCID Bulk Interface] 00 00

Mon May 25 13:13:16 2020
 Reader 0: ActivIdentity Activkey_Sim [CCID Bulk Interface] 00 00
  Event number: 0
  Card state: Card inserted, Unresponsive card,
 /

Reporting this Unresponsive Card, when it should detect the card?

sudo service pcscd status
● pcscd.service - PC/SC Smart Card Daemon
     Loaded: loaded (/lib/systemd/system/pcscd.service; indirect; vendor preset: enabled)
     Active: inactive (dead) since Mon 2020-05-25 13:14:24 CEST; 29s ago
TriggeredBy: ● pcscd.socket
       Docs: man:pcscd(8)
    Process: 16280 ExecStart=/usr/sbin/pcscd --foreground --auto-exit (code=exited, status=0/SUCCESS)
   Main PID: 16280 (code=exited, status=0/SUCCESS)

svi 25 13:12:59 rodigerlaptop1 pcscd[16280]: 00000268 commands.c:249:CmdPowerOn Card absent or mute
svi 25 13:12:59 rodigerlaptop1 pcscd[16280]: 00000007 ifdhandler.c:1221:IFDHPowerICC() PowerUp failed
svi 25 13:12:59 rodigerlaptop1 pcscd[16280]: 00000004 eventhandler.c:305:EHStatusHandlerThread() Error powering up card: 2148532246 0x80100016
svi 25 13:13:11 rodigerlaptop1 pcscd[16280]: 11584403 ccid_usb.c:857:WriteUSB() write failed (1/7): -4 LIBUSB_ERROR_NO_DEVICE
svi 25 13:13:16 rodigerlaptop1 pcscd[16280]: 04928359 commands.c:249:CmdPowerOn Card absent or mute
svi 25 13:13:16 rodigerlaptop1 pcscd[16280]: 00000240 commands.c:249:CmdPowerOn Card absent or mute
svi 25 13:13:16 rodigerlaptop1 pcscd[16280]: 00000260 commands.c:249:CmdPowerOn Card absent or mute
svi 25 13:13:16 rodigerlaptop1 pcscd[16280]: 00000006 ifdhandler.c:1221:IFDHPowerICC() PowerUp failed
svi 25 13:13:16 rodigerlaptop1 pcscd[16280]: 00000004 eventhandler.c:305:EHStatusHandlerThread() Error powering up card: 2148532246 0x80100016
svi 25 13:14:24 rodigerlaptop1 systemd[1]: pcscd.service: Succeeded.

Revision history for this message
Dejan (dejan-rodiger) wrote :
Download full text (4.9 KiB)

sudo lsusb |grep ActivKey
Bus 001 Device 008: ID 09c3:0014 HID Global ActivIdentity ActivKey SIM USB Token

lsusb -D /dev/bus/usb/001/008
Device: ID 09c3:0014 HID Global ActivIdentity ActivKey SIM USB Token
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.00
  bDeviceClass 0
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 16
  idVendor 0x09c3 HID Global
  idProduct 0x0014 ActivIdentity ActivKey SIM USB Token
  bcdDevice 2.07
  iManufacturer 1 ActivIdentity
  iProduct 2 Activkey_Sim
  iSerial 0
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 0x005d
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 3 CCID 1.10
    bmAttributes 0x80
      (Bus Powered)
    MaxPower 100mA
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 3
      bInterfaceClass 11 Chip/SmartCard
      bInterfaceSubClass 0
      bInterfaceProtocol 0
      iInterface 4 CCID Bulk Interface
      ChipCard Interface Descriptor:
        bLength 54
        bDescriptorType 33
        bcdCCID 1.10 (Warning: Only accurate for version 1.0)
        nMaxSlotIndex 0
        bVoltageSupport 7 5.0V 3.0V 1.8V
        dwProtocols 3 T=0 T=1
        dwDefaultClock 4800
        dwMaxiumumClock 4800
        bNumClockSupported 0
        dwDataRate 12903 bps
        dwMaxDataRate 412903 bps
        bNumDataRatesSupp. 0
        dwMaxIFSD 254
        dwSyncProtocols 00000000
        dwMechanical 00000000
        dwFeatures 00010030
          Auto clock change
          Auto baud rate change
          TPDU level exchange
        dwMaxCCIDMsgLen 271
        bClassGetResponse 00
        bClassEnvelope 00
        wlcdLayout none
        bPINSupport 0
        bMaxCCIDBusySlots 1
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x01 EP 1 OUT
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0040 1x 64 bytes
        bInterval 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x82 EP 2 IN
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0040 1x 64 bytes
        bInterval 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x83 EP 3 IN
        bmAt...

Read more...

Revision history for this message
Dejan (dejan-rodiger) wrote :

After pcscd restart, I see ActivKey got new Device ID

Revision history for this message
Dejan (dejan-rodiger) wrote :

pcscd log when I pulled USB out and put it back in.

Revision history for this message
Dejan (dejan-rodiger) wrote :

It gets new USB Device ID every time I plugin the Key
ID 11, re plugin, ID 12...

root@rodigerlaptop1:/dev/bus/usb/001# ls -la
total 0
drwxr-xr-x 2 root root 180 svi 25 13:29 .
drwxr-xr-x 6 root root 120 svi 25 13:11 ..
crw-rw-r-- 1 root root 189, 0 svi 25 13:11 001
crw-rw-r-- 1 root root 189, 1 svi 25 13:11 002
crw-rw-r-- 1 root root 189, 2 svi 25 13:11 003
crw-rw-r-- 1 root root 189, 3 svi 25 13:11 004
crw-rw-r-- 1 root root 189, 4 svi 25 13:11 005
crw-rw-r-- 1 root root 189, 5 svi 25 13:11 006
crw-rw-r-- 1 root root 189, 10 svi 25 13:29 011
root@rodigerlaptop1:/dev/bus/usb/001# ls -la
total 0
drwxr-xr-x 2 root root 180 svi 25 13:33 .
drwxr-xr-x 6 root root 120 svi 25 13:11 ..
crw-rw-r-- 1 root root 189, 0 svi 25 13:11 001
crw-rw-r-- 1 root root 189, 1 svi 25 13:11 002
crw-rw-r-- 1 root root 189, 2 svi 25 13:11 003
crw-rw-r-- 1 root root 189, 3 svi 25 13:11 004
crw-rw-r-- 1 root root 189, 4 svi 25 13:11 005
crw-rw-r-- 1 root root 189, 5 svi 25 13:11 006
crw-rw-r-- 1 root root 189, 11 svi 25 13:33 012

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

from your log I can see when you removed the device:
00000016 [139787462866688] ccid_usb.c:857:WriteUSB() write failed (1/10): -4 LIBUSB_ERROR_NO_DEVICE

Your problem is that reader can not power up the card after the reader is inserted again.
00000003 [139787471259392] ifdhandler.c:1221:IFDHPowerICC() PowerUp failed

What is strange is that the first time the card power up is very slow but works fine.
The second time the reader responds very quickly with an error.

I don't think the driver can do much to solve that.
Do you have the same result if you use a different smart card?

Revision history for this message
Dejan (dejan-rodiger) wrote :

This one is still working on Windows PC. And it was also working on previous version of Ubuntu 19.04

I notice, that first time I plug it in, VMWAre Workstation with Windows VM also see this in its USB device list. But then windows software just can't read it. So, first time after reboot, Key even becomes Green, but than when it try's to access it, it changes to Red.

Revision history for this message
Dejan (dejan-rodiger) wrote :

Hi, here is the scan status for different Gemalto USB Key. I think this is working OK?

sudo pcsc_scan
Using reader plug'n play mechanism
Scanning present readers...
Waiting for the first reader...found one
Scanning present readers...
0: Gemalto USB Shell Token V2 (9BB8D562) 00 00

Wed May 27 07:58:26 2020
 Reader 0: Gemalto USB Shell Token V2 (9BB8D562) 00 00
  Event number: 0
  Card state: Card inserted,
  ATR: 3B 7F 96 00 00 80 31 80 65 B0 84 41 3D F6 12 0F FE 82 90 00

ATR: 3B 7F 96 00 00 80 31 80 65 B0 84 41 3D F6 12 0F FE 82 90 00
+ TS = 3B --> Direct Convention
+ T0 = 7F, Y(1): 0111, K: 15 (historical bytes)
  TA(1) = 96 --> Fi=512, Di=32, 16 cycles/ETU
    250000 bits/s at 4 MHz, fMax for Fi = 5 MHz => 312500 bits/s
  TB(1) = 00 --> VPP is not electrically connected
  TC(1) = 00 --> Extra guard time: 0
+ Historical bytes: 80 31 80 65 B0 84 41 3D F6 12 0F FE 82 90 00
  Category indicator byte: 80 (compact TLV data object)
    Tag: 3, len: 1 (card service data byte)
      Card service data byte: 80
        - Application selection: by full DF name
        - EF.DIR and EF.ATR access services: by GET RECORD(s) command
        - Card with MF
    Tag: 6, len: 5 (pre-issuing data)
      Data: B0 84 41 3D F6
    Tag: 1, len: 2 (country code, ISO 3166-1)
      Country code: 0F FE
    Tag: 8, len: 2 (status indicator)
      SW: 9000

Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):
3B 7F 96 00 00 80 31 80 65 B0 84 41 3D F6 12 0F FE 82 90 00
3B 7F .. 00 00 80 31 80 65 B0 .. .. .. .. 12 0F FE 82 90 00
 IDPrime MD 8840, 3840, 3810, 840 and 830 Cards T=0
3B 7F 96 00 00 80 31 80 65 B0 84 41 3D F6 12 0F FE 82 90 00
 Gemalto IDPrime MD

Revision history for this message
Dejan (dejan-rodiger) wrote :

I tested this Gemalto under VMWAre Workstation on Windows VM and Client App see the Reader and then Smart Card Info. So there is something incorrect on the ActivKey support in pcscd?

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

You are right. It looks like a problem with the ActivKey device.
I don't see what change could have created this regression.

First, do not use virtual machine. They often make the things more complex to debug.
Second, try to re-install a previous version of Ubuntu to check it was working fine.

Revision history for this message
Ludovic Rousseau (ludovic-rousseau-gmail) wrote :

The fact that the LED is green then goes to red after a few seconds is completely normal.
See https://ludovicrousseau.blogspot.com/2010/10/card-auto-power-on-and-off.html

The fact that you get "PowerUp failed" errors is NOT normal.
It is a hardware issue with the card and/or the reader.

That is why I asked you to try with another smart card.

On my side I tried with current version of pcsc-lite and libccid and I have no problem with my ActivIdentity Activkey_Sim device.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.