Operating system: Ubuntu 18.04.2 LTS
Smart card: OpenPGP Smart Card V2.1
I have two different smartcard readers:
Both readers work fine when pcscd is installed. But when I remove pcscd, only the Cherry ST-2000 reader will work. With the Gemalto Ezio Shield, gpg --card-status all won't print anything, and the following error is reported in scdaemon's debug output:
2019-07-24 17:53:05 scdaemon[31116] reader slot 0: using ccid driver 2019-07-24 17:53:05 scdaemon[31116] slot 0: ATR=3B DA 18 FF 81 B1 FE 75 1F 03 00 31 C5 73 C0 01 40 00 90 00 0C 2019-07-24 17:53:05 scdaemon[31116] DBG: enter: apdu_connect: slot=0 2019-07-24 17:53:05 scdaemon[31116] DBG: leave: apdu_connect => sw=0x0 2019-07-24 17:53:05 scdaemon[31116] DBG: send apdu: c=00 i=A4 p1=00 p2=0C lc=2 le=-1 em=0 2019-07-24 17:53:05 scdaemon[31116] DBG: raw apdu: 00 A4 00 0C 02 3F 00 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: PC_to_RDR_XfrBlock: 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: dwLength ..........: 7 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bSlot .............: 0 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bSeq ..............: 4 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bBWI ..............: 0x04 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: wLevelParameter ...: 0x0000 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: [0010] 00 A4 00 0C 02 3F 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: [0016] 00 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: RDR_to_PC_DataBlock: 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: dwLength ..........: 0 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bSlot .............: 0 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bSeq ..............: 4 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bStatus ...........: 64 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bError ............: 7 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: CCID command failed: Parameter error at offset 7 2019-07-24 17:53:05 scdaemon[31116] apdu_send_simple(0) failed: unknown status error 2019-07-24 17:53:05 scdaemon[31116] DBG: send apdu: c=00 i=A4 p1=04 p2=00 lc=6 le=-1 em=0 2019-07-24 17:53:05 scdaemon[31116] DBG: raw apdu: 00 A4 04 00 06 D2 76 00 01 24 01 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: PC_to_RDR_XfrBlock: 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: dwLength ..........: 11 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bSlot .............: 0 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bSeq ..............: 5 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bBWI ..............: 0x04 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: wLevelParameter ...: 0x0000 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: [0010] 00 A4 04 00 06 D2 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: [0016] 76 00 01 24 01 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: RDR_to_PC_DataBlock: 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: dwLength ..........: 0 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bSlot .............: 0 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bSeq ..............: 5 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bStatus ...........: 64 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: bError ............: 7 2019-07-24 17:53:05 scdaemon[31116] DBG: ccid-driver: CCID command failed: Parameter error at offset 7 2019-07-24 17:53:05 scdaemon[31116] apdu_send_simple(0) failed: unknown status error 2019-07-24 17:53:05 scdaemon[31116] can't select application 'openpgp': Nicht unterstützt 2019-07-24 17:53:05 scdaemon[31116] DBG: enter: apdu_close_reader: slot=0 2019-07-24 17:53:05 scdaemon[31116] DBG: enter: apdu_disconnect: slot=0 2019-07-24 17:53:05 scdaemon[31116] DBG: leave: apdu_disconnect => sw=0x0
I've enabled debugging in my scdaemon.conf with the following configuration:
verbose debug-level guru debug-ccid-driver log-file /home/martin/scdaemon.log
The full scdaemon.log is attached below.
The reasons why I want to remove pcscd are:
- Some colleagues are using MacOS, where pcscd is not available; this problem seems to affects them too - the Cherry reader works fine, the Gemalto reader doesn't work at all.
- We are considering to use multiple smartcards at the same time for OpenSSH MFA (e.g. a user needs to have two smartcards inserted at the same time to connect to a server). As far as I know, using multiple smartcard readers and smartcards at the same time is only supported by scdaemon's internal CCID driver, and doesn't work with pcscd. At least I was only able to get it working with two Cherry readers and the internal CCID driver, and not with pcscd installed.
I suspect that the Gemalto reader is probably doing something stupid (I've seen workarounds both in [[ https://salsa.debian.org/rousseau/CCID/blob/master/src/ccid.c#L461 | libccid's code ]] and in [[ https://dev.gnupg.org/source/gnupg/browse/master/scd/ccid-driver.c;044379772fc5b0f39c6a36809722e702808b6ec3$1239 | scdaemon's code ]] for an issue where the readers send a VERIFY command with an empty PIN to the card, which the OpenPGP smart card apparently doesn't support).
I've tried to fiddle with the code to see if a similar workaround might fix the issue for my Gemalto reader, but I'm afraid this hasn't led anywhere. I understand that this probably isn't easy to fix without access to this specific smart card reader, but if anyone has any suggestions what I could try out, they would be appreciated :)