Due to an influx of spam, we have had to temporarily disable account registrations. Please write an email to accountsupport@archlinux.org, with your desired username, if you want to get access. Sorry for the inconvenience.
OpenSC 0.26.0-2 prevents GnuPG from using my Nitrokey 3C, claiming it can't find any card. Removing /usr/share/p11-kit/modules/opensc.module and restarting pcscd.service resolves the issue.
> gpg --edit-cardgpg: selecting card failed: No such devicegpg: OpenPGP card not available: No such devicegpg/card>
From what I can see this happens because scdaemon by default insists on exclusive access to the hardware token. From looking around, adding the following to ~/.gnupg/scdaemon.conf should fix the issue:
disable-ccidpcsc-shared
I would still like to see the module in the opensc package. If my suggested fix works, can this workaround be posted via the news mailing list so we can land this change after all?
@genesso Sorry, you also have to restart scdaemon by running gpgconf --kill scdaemon. I just tested with my own yubikey and this fixes the issue for me.
But it would be better if work around didn't require every user to make a change. Is there a way to have a system wide setting instead?
There is /etc/gnupg/scdaemon.conf, but I don't think this workaround can be applied generally unless the gnupg package gets a dependency on p11-kit and opensc and pcsc-lite as otherwise pcsc can't be used. Only users that are already using pcsc-lite should use this workaround.
As I mentioned, applying the gnupg workaround globally means adding a dependency on pcsc-lite to gnupg. If that's acceptable we could apply the workaround globally. But since this only happens if p11-kit and opensc are installed with pcscd enabled and running, I think it will be rare enough that a NEWS item will suffice.
Unfortunately, pcsc-shared causes GnuPG to ask for the key's PIN for every single signature instead of just the first, which is quite painful. So that's not an option for me. I uninstalled opensc instead.
In addition, any interaction with the Nitrokey via pkcs11 while GnuPG has it unlocked confuses GnuPG and any attempt to sign fails with "Bad PIN" until either scdaemon is killed or the key is replugged.
And FTR, a blank scdaemon.conf (so the internal CCID driver is used) has the same issue as disable-ccid without pcsc-shared. GnuPG cannot see the card at all.