Yubico / ykneo-openpgp

OpenPGP applet for the YubiKey NEO
https://developers.yubico.com/ykneo-openpgp/
GNU General Public License v2.0
215 stars 67 forks source link

Lingering application `OPENPGP' #37

Open jplitza opened 8 years ago

jplitza commented 8 years ago

Hi,

I am not sure whether this is a problem in the applet or the gpg-agent or something completely different. So I beg pardon if this is the wrong end to ask, but I didn't get any replies on gnupg-users either.

Apparently, after using an authentication key for SSH via gpg-agent, keeping the session open and ejecting the card, the session has to be closed to regain access to the card. Steps to reproduce:

  1. Configure your Yubikey NEO to eject the card on button press: ykneomgr -M81 Re-plug it afterwards!
  2. Insert the Yubikey and press button to insert the (virtual) card
  3. Use the authentication key stored on the card to log in to a SSH host
  4. Press button to remove the (virtual) card (or wait if you have a timeout for auto-eject configured)
  5. Press button to insert the (virtual) card again
  6. Do anything that requires the card (e.g. gpg -d): gpg: public key decryption failed: Conflicting use

In the log of scdaemon, the following line is striking:

scdaemon[7601] lingering application `OPENPGP' in use by reader 0 - can't switch

Now while killing and restarting the gpg-agent makes the applet accessible again as well, I'm under the impression that this should not happen: If I "eject" the card, everything that was opened should be forgotten, shouldn't it? That's why I'm thinking this might be a problem of the applet. If it isn't, welp, I'll have to search somewhere else to complain. ;-)