[Pcsclite-muscle] Issue when plugging yubikey after pcscd has started

Ludovic Rousseau ludovic.rousseau at gmail.com
Tue Jan 16 12:57:39 PST 2024


Le mar. 16 janv. 2024 à 09:20, Laurent Bigonville <bigon at bigon.be> a écrit :
>
> Hello,

Hello Laurent,

> I've an issue that when I'm plugging the my yubikey 5 while pcscd is
> already running, gpg/scdaemon cannot communicate with it. If I'm
> plugging it and then I'm starting the daemon, it works fine. I'm
> suspecting that it might be happening with all smartcard reader plugged
> after the daemon has started.
>
> I'm running debian unstable (pcscd: 2.0.1-1 - libccid 1.5.5-1 - gpg
> 2.2.40-1.1+b1). I uninstalled opensc completely to avoid interferences.
>
> $ sudo pcscd --version
> pcsc-lite version 2.0.1.
> Copyright (C) 1999-2002 by David Corcoran<corcoran at musclecard.com>.
> Copyright (C) 2001-2022 by Ludovic Rousseau<ludovic.rousseau at free.fr>.
> Copyright (C) 2003-2004 by Damien Sauveron<sauveron at labri.fr>.
> Report bugs to<pcsclite-muscle at lists.infradead.org>.
> Enabled features: Linux x86_64-pc-linux-gnu libsystemd serial usb libudev polkit usbdropdir=/usr/lib/pcsc/drivers ipcdir=/run/pcscd filter configdir=/etc/reader.conf.d
> MAX_READERNAME: 128, PCSCLITE_MAX_READERS_CONTEXTS: 16
>
> scdaemon is configured as follow:
>
> $ cat .gnupg/scdaemon.conf
> pcsc-driver /usr/lib/x86_64-linux-gnu/libpcsclite.so.1
> card-timeout 5
> disable-ccid
> pcsc-shared
>
> $ LC_ALL=C gpg --card-status
> gpg: selecting card failed: No such device
> gpg: OpenPGP card not available: No such device
>
> I've attached the logs generated with the following procedure:
>
> 1. Stop scdaemon and pcscd
> 2. Plug the yubikey (only for the plugged_before log file)
> 3. Start pcscd
> 4. Run gpg --card-status
> 5. Unplug the yubikey
> 6. Ctrl-C the daemon
>
> Any idea what's happening here?

I your log pcscd.log so, with pcscd started after the token is
inserted, I see NO APDU exchanges.
I looks like "gpg --card-status" is NOT using pcscd while it should
since you have the option "disable-ccid" in ~/.gnupg/scdaemon.conf
Do you get the expected results at step 4?

Your problem really looks like "GnuPG and PC/SC conflicts"
https://blog.apdu.fr/posts/2019/06/gnupg-and-pcsc-conflicts/

I will try to reproduce the problem in my side.

Bye

-- 
 Dr. Ludovic Rousseau



More information about the pcsclite-muscle mailing list