Actions and expected behavior
Hi! I've been trying to use gpg exclusively via pcsc-lite by adding disable-ccid to ~/.gnupg/scdaemon.conf.
Unfortunately, I'm experiencing quite weird behavior when trying to use my Yubikey.
My simple test case is to just execute gpg --card-status, which ideally should work instantly at any time.
What I experience instead
The first gpg --card-status fails with:
gpg: selecting card failed: End of file gpg: OpenPGP card not available: End of file
while the following is logged to the syslog:
May 01 13:08:05 kernel: pipe-connection: segfault at 0 ip 00007f39626622de sp 00007f3962434b18 error 4 in libc.so.6[7f396251c000+169000] May 01 13:08:05 kernel: Code: 00 00 00 00 00 0f 1f 80 00 00 00 00 89 f8 31 d2 c5 c1 ef ff 09 f0 25 ff 0f 00 00 3d 80 0f 00 00 0f 8f 56 03 00 00 c5 fe 6f 0f <c5> f5 74 06 c5 fd da c1 c5 fd 74 c7 c5 fd d7 c8 85 c9 74 7e f3 0f May 01 13:08:05 systemd: Started Process Core Dump (PID 1878669/UID 0). May 01 13:08:05 systemd-coredump: Resource limits disable core dumping for process 1877413 (scdaemon). May 01 13:08:05 systemd-coredump: [🡕] Process 1877413 (scdaemon) of user 1000 dumped core. May 01 13:08:05 systemd: firstname.lastname@example.org: Deactivated successfully.
The second try always succeeds when a fresh pcsc daemon was started by udev.
When unplugging the yubikey, pcsc throws a bunch of errors and will cause
any subsequently inserted yubikeys to be unusable until pcsc is killed.
At first I thought this is related to pcsc-lite, please see the detailed bug report over on
their issue tracker (https://github.com/LudovicRousseau/PCSC/issues/125). It includes my detailed syslog
messaged and exact descriptions of what I did. At the end of the main post I've also included pcsc logs.
My intentions are to use my yubikey via pcsc so I can also use it with PAM and firefox,
which is why I used disable-ccid to avoid gpg from using the device. I'm unsure what
causes this issue, but I have observed it since at least Februrary 2022 (I don't remember having any problems for years before that using this exact same setup)
A fresh system re-setup didn't solve it. I'm trying a shot in the dark here, but since I don't have any problems using the same software on a different computer,
I guess it could be related to my laptop's USB host controller, as I'm seeing a lot of usb errors when removing the yubikey (see the pcsc bug report for details).
I'm on a freshly setup gentoo system.
- libusb 1.0.26
- gpg (GnuPG) 2.3.5
- libgcrypt 1.10.1
- Using my Yubikey 5C NFC (also occurs with any other yubikey I had at hand)