gpg: selecting card failed: Operation not supported by device

John's Avatar

John

16 Jun, 2021 10:21 PM

Hello,

This subject is related to these discussions:

https://gpgtools.tenderapp.com/discussions/feedback/16473-gpg-selec...
https://gpgtools.tenderapp.com/discussions/feedback/16194-gpg-selec...

After rebooting my Macbook today, after a GPG tools update i started being unable to use gpg with my yubikey. I get the following errors:

gpg --card-status
gpg: selecting card failed: Operation not supported by device
gpg: OpenPGP card not available: Operation not supported by device

From all other perspectives the key looks fine: the OS recognizes it, ykman lists it, etc.

Attaching screenshot of installed version.

I'm not sure what is the problem here as I haven't tried debugging it deep enough, but from my googling this looks like a common regression in gnupg

  1. 1 Posted by John on 17 Jun, 2021 02:10 PM

    John's Avatar

    Wanted to add this here, this is the log from scdaemon:

    2021-06-17 15:07:37 scdaemon[1990] listening on socket '/Users/<redacted>/.gnupg/S.scdaemon'
    2021-06-17 15:07:37 scdaemon[1990] handler for fd -1 started
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 -> OK GNU Privacy Guard's Smartcard server ready
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 <- GETINFO socket_name
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 -> D /Users/<redacted>/.gnupg/S.scdaemon
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 -> OK
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 <- OPTION event-signal=31
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 -> OK
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 <- GETINFO version
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 -> D 2.2.27
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 -> OK
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 <- SERIALNO
    2021-06-17 15:07:37 scdaemon[1990] DBG: enter: apdu_open_reader: portstr=(null)
    2021-06-17 15:07:37 scdaemon[1990] detected reader 'Generic Smart Card Reader Interface'
    2021-06-17 15:07:37 scdaemon[1990] detected reader 'Yubico YubiKey OTP+FIDO+CCID'
    2021-06-17 15:07:37 scdaemon[1990] detected reader ''
    2021-06-17 15:07:37 scdaemon[1990] reader slot 0: not connected
    2021-06-17 15:07:37 scdaemon[1990] DBG: leave: apdu_open_reader => slot=0 [pc/sc]
    2021-06-17 15:07:37 scdaemon[1990] DBG: enter: apdu_connect: slot=0
    2021-06-17 15:07:37 scdaemon[1990] reader slot 0: not connected
    2021-06-17 15:07:37 scdaemon[1990] DBG: leave: apdu_connect => sw=0x10008
    2021-06-17 15:07:37 scdaemon[1990] DBG: enter: apdu_close_reader: slot=0
    2021-06-17 15:07:37 scdaemon[1990] DBG: enter: apdu_disconnect: slot=0
    2021-06-17 15:07:37 scdaemon[1990] DBG: leave: apdu_disconnect => sw=0x0
    2021-06-17 15:07:37 scdaemon[1990] DBG: leave: apdu_close_reader => 0x0 (close_reader)
    2021-06-17 15:07:37 scdaemon[1990] DBG: chan_7 -> ERR 100696144 Operation not supported by device <SCD>
    2021-06-17 15:07:38 scdaemon[1990] DBG: chan_7 <- RESTART
    2021-06-17 15:07:38 scdaemon[1990] DBG: chan_7 -> OK
    
  2. 2 Posted by John on 17 Jun, 2021 02:17 PM

    John's Avatar

    Hey,

    You can close this discussion as solved, I was able to locate the problem.

    For some reason scdaemon was looking at a USB smart card reader I have for the PGP keys. Since the reader had no card inserted it was failing and not checking the Yubikey.

    Solution is to either remove the reader, or to add the following in ~/.gnupg/scdaemon.conf:

    reader-port Yubico Yubikey
    

    After this it started working.

    Apologies for the noise.

    https://support.yubico.com/hc/en-us/articles/360013714479-Troublesh...

  3. Support Staff 3 Posted by Steve on 17 Jun, 2021 09:47 PM

    Steve's Avatar

    Hi John,

    thanks for reporting the problem and also sharing your solution. As this discussion is public maybe it will help others running into a similar situation.

    Glad this is already solved for you. I'm closing this discussion. Should you need further assistance or have questions you can re-open this discussion here or open a new one any time.

    Best,
    Steve

  4. Steve closed this discussion on 17 Jun, 2021 09:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac