Page MenuHome GnuPG

gpg-agent 2.3.2 conflicts with pcscd
Closed, ResolvedPublic

Description

environment: gentoo linux, openrc
when I read the yubikey card status with gpg 2.3.2, error occures:

 ~ › gpg --card-status
gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

debug scd, and this is the log:

…
…
2021-09-30 19:57:41 scdaemon[13375] DBG: ccid-driver:   wlcdLayout           none
2021-09-30 19:57:41 scdaemon[13375] DBG: ccid-driver:   bPINSupport             0 
2021-09-30 19:57:41 scdaemon[13375] DBG: ccid-driver:   bMaxCCIDBusySlots       1
2021-09-30 19:57:41 scdaemon[13375] DBG: ccid-driver: usb_claim_interface failed: -6
2021-09-30 19:57:41 scdaemon[13375] ccid open error: skip
…

I check the libusb code here, and it seems to be in conflict with pcscd. gpg 2.3.2 works fine if pcscd stoped.

Version 2.2.29 has the same problem but 2.2.29 will fallback to use PC/SC driver instead. ( The pcscd is the dependence of yubikey-manager for OTP feature, I have to use it. )

Full debug logs with the following scdaemon.conf are here: scd.log , gpg --debug ipc --card-status

debug-all
debug-level guru
log-file /tmp/scd.log
debug-ccid-driver
verbose
verbose
verbose

I can use gpg 2.3.2 normally by adding disable-ccid to scdaemon.conf, however I am not sure if this is a bug or the design is the way it is, so I post it here.

And, gpg 2.3.2 cannot show the correct version by gpg --card-status, it's always 0.0 whether it uses ccid-driver or PC/SC.

Details

Version
2.3.2

Event Timeline

gniibe triaged this task as Normal priority.
gniibe added a project: yubikey.
gniibe added a subscriber: gniibe.

For 2.3, when you use PC/SC, please use the disable-ccid option in your .gnupg/scdaemon.conf.

The mechanism of fallback to PC/SC was removed in 2.3. ( T4673)
(It worked some cases (like yours), but had been cause of many confusion/trouble.)

BTW, in 2.3, multiple cardreader/token support is introduced.

werner edited projects, added Not A Bug; removed Bug Report.