Mailing List Archive

OpenPGP card not available
Running "gpg --card-status" with a configured Yubikey plugged in on an x86_64
Linux machine just gives me these errors when running 2.4.5:

gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

However, leaving everything else the same and just running 2.2.42 (& earlier
2.2.x) gives me the output I'd expect with that command. I've tried some of
the advice I've found of adding "reader-port Yubico Yubi" and "pcsc-shared" to
scdaemon.conf didn't make a difference. Enabling some scdaemon logging shows
this interesting bit in the log file:

2024-04-08 16:45:28 scdaemon[62168] DBG: chan_7 <- SERIALNO
2024-04-08 16:45:28 scdaemon[62168] DBG: apdu_open_reader: BAI=70202
2024-04-08 16:45:28 scdaemon[62168] DBG: apdu_open_reader: new device=70202
2024-04-08 16:45:28 scdaemon[62168] ccid open error: skip
2024-04-08 16:45:28 scdaemon[62168] DBG: chan_7 -> ERR 100696144 No such device <SCD>

With 2.2.42, I see this (with an actual serial number) and all works well:

2024-04-08 16:38:43 scdaemon[36563] DBG: chan_7 <- SERIALNO
2024-04-08 16:38:43 scdaemon[36563] DBG: apdu_open_reader: BAI=70202
2024-04-08 16:38:43 scdaemon[36563] DBG: apdu_open_reader: new device=70202
2024-04-08 16:38:43 scdaemon[36563] ccid open error: skip
2024-04-08 16:38:43 scdaemon[36563] DBG: chan_7 -> S SERIALNO D0000000000000000000000000000000
2024-04-08 16:38:43 scdaemon[36563] DBG: chan_7 -> OK
...

Running "echo SERIALNO | scd/scdaemon --server" is enough. I've tried both
pcsc-lite 1.9.9 and 2.0.3 without a difference. I'm not sure how to drill
down to figure out further to figure out what else could be causing the
failure. One obvious difference is that the working version is linked against
libpthread.so.0 but the failing one is linked against libnpth.so.0, but that
seems to have to do with locking which I wouldn't expect to make difference
with a simple local test.

I was hoping to bisect to the problem except that the 2.3 and 2.4 branches fail
at their .0 versions. Does someone have a suggestion to debug further?

Dan

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
OpenPGP card not available [ In reply to ]
Running "gpg --card-status" with a configured Yubikey plugged in on an x86_64
Linux machine just gives me these errors when running 2.4.5:

gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

However, leaving everything else the same and just running 2.2.42 (& earlier
2.2.x) gives me the output I'd expect with that command. I've tried some of
the advice I've found of adding "reader-port Yubico Yubi" and "pcsc-shared" to
scdaemon.conf didn't make a difference. Enabling some scdaemon logging shows
this interesting bit in the log file:

2024-04-08 16:45:28 scdaemon[62168] DBG: chan_7 <- SERIALNO
2024-04-08 16:45:28 scdaemon[62168] DBG: apdu_open_reader: BAI=70202
2024-04-08 16:45:28 scdaemon[62168] DBG: apdu_open_reader: new device=70202
2024-04-08 16:45:28 scdaemon[62168] ccid open error: skip
2024-04-08 16:45:28 scdaemon[62168] DBG: chan_7 -> ERR 100696144 No such device <SCD>

With 2.2.42, I see this (with an actual serial number) and all works well:

2024-04-08 16:38:43 scdaemon[36563] DBG: chan_7 <- SERIALNO
2024-04-08 16:38:43 scdaemon[36563] DBG: apdu_open_reader: BAI=70202
2024-04-08 16:38:43 scdaemon[36563] DBG: apdu_open_reader: new device=70202
2024-04-08 16:38:43 scdaemon[36563] ccid open error: skip
2024-04-08 16:38:43 scdaemon[36563] DBG: chan_7 -> S SERIALNO D0000000000000000000000000000000
2024-04-08 16:38:43 scdaemon[36563] DBG: chan_7 -> OK
...

Running "echo SERIALNO | scd/scdaemon --server" is enough. I've tried both
pcsc-lite 1.9.9 and 2.0.3 without a difference. I'm not sure how to drill
down to figure out further to figure out what else could be causing the
failure. One obvious difference is that the working version is linked against
libpthread.so.0 but the failing one is linked against libnpth.so.0, but that
seems to have to do with locking which I wouldn't expect to make difference
with a simple local test.

I was hoping to bisect to the problem except that the 2.3 and 2.4 branches fail
at their .0 versions. Does someone have a suggestion to debug further?

Dan

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: OpenPGP card not available [ In reply to ]
On Mon, 8 Apr 2024 21:50, Dan Fandrich said:

> Running "echo SERIALNO | scd/scdaemon --server" is enough. I've tried both
> pcsc-lite 1.9.9 and 2.0.3 without a difference. I'm not sure how to drill

By default we are not using PC/SC on Linux but direct access to the
reader via USB. Now if pcscd is already running and has access to the
reader scdaemon won't be able to access the reader via USB.

2.2 falls back to PC/SC if it can't use the reader via USB.

Either shutdown pcscd or add

disable-ccid-driver

to ~/.gnupg/scdaemon.conf

More debug output can be logged by adding

debug cardio
debug-ccid-reader


Shalom-Salam,

Werner


--
The pioneers of a warless world are the youth that
refuse military service. - A. Einstein
Re: OpenPGP card not available [ In reply to ]
On Tue, Apr 09, 2024 at 12:11:31PM +0200, Werner Koch wrote:
> By default we are not using PC/SC on Linux but direct access to the
> reader via USB. Now if pcscd is already running and has access to the
> reader scdaemon won't be able to access the reader via USB.
>
> 2.2 falls back to PC/SC if it can't use the reader via USB.

That explains the difference it nicely.

> Either shutdown pcscd or add
>
> disable-ccid-driver
>
> to ~/.gnupg/scdaemon.conf

Shutting down pcscd fixed it! But I have other software that needs pcscd to
access the card, so I added "disable-ccid" to scdaemon.conf and gpg now works
even though pcscd is running. Thanks for the help.

Dan

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users