Nitrokey 3A NFC smart card and firmware update failing

I have been using the Nitrokey 3A NFC for several things, FIDO2 as well as smart card for GPG and SSH. While FIDO2 still works, the smart card device has not been recognized since the beginning of this week. It could be related to my trials to get firmware updates for Nitrokey HSM allthough those are still recognized by SmartCardShell. NitrokeyApp 2 still recognizes Nitrokey 3A NFC, but udating the firmware fails with the following error:

Bildschirmfoto vom 2025-11-18 17-00-23

If I unplug it and reconnect it, FIDO2 still works and I can repeat the process with the same result. Any suggestions on what I could do?

I had to uninstall pcsc and scdaemon, reinstall again and then follow the Troubleshooting - Nitrokey Documentation section again and it finally works.

1 Like

Unfortunately I have to reopen this topic:

The aforementioned solution works, but every 2-3 days, I have to repeat reinstalling and doing the troubleshooting again:

sudo apt remove pcsc scdaemon
sudo apt install pcsc scdaemon
gpg-connect-agent "SCD KILLSCD" /bye

And of course leavingdisable-ccid in ~/.gnupg/scdaemon.conf

I noticed that there might be an issue with a second SmartCard/TPM being part of my computer:
If it works, pcsc_scan -r returns

0: Nitrokey Nitrokey 3 [CCID/ICCD Interface] 00 00
1: Broadcom Corp 58200 [Contacted SmartCard] (***) 01 00

but if it doesn’t, the order is switched

0: Broadcom Corp 58200 [Contacted SmartCard] (***) 01 00
1: Nitrokey Nitrokey 3 [CCID/ICCD Interface] 00 00

I think this might actually be related to using the Nitrokey HSM, because SCSH also shows

GPError: Card (CARD_CONNECT_FAILED/0) - “No card in reader or mute card.” in /home/…/CardContact/scsh/scsh-3.18.60/keymanager/keymanager.js#3346at /home/…/CardContact/scsh/scsh-3.18.60/keymanager/keymanager.js#3346

when Nitrokey 3 is working but SCSH doesn’t have a problem connecting Nitrokey HSM, when I can’t access the Nitrokey 3 smart card.

1 Like

Hello,

is your Nitrokey 3 in bootloader mode ? (BL)

what’s the output of lsusb while is plugged ?

Bus 003 Device 015: ID 20a0:4230 Clay Logic Nitrokey HSM

the issue is likely using gnupg (note: the standard is called pgp - pretty good privacy - the common used implementation is calld gpg - gnupg - gnu/privacyguard)
unfortunately gnupg has a very bad habbit of lazily grabbing a lock onto a smartcard (no matter if via built-in scdaemon or when using disable-ccid in scdaemon.conf via pcscd) and keeps onto it until either

  • the token is replugged
  • gpgconf –kill all is called
  • systemctl stop pcscd is called
  • using gpg-card and issue the command reset followed by immediate quit

I analyzed this digging thru the gnupg code while having a similar issue with my yubikey trying to use it with all its features (pgp, piv, fido) and learned that gnupg doesn’t properly release the lock.

I reported this to gnupg - but its maintainers have the rather strange attitude of “we become the de-factor standard of pgp - if you want to use pgp - use gnupg - and gnupg only! we refuse to change our code - and also refuse to accept this report as a bug of our code as it works fine as long as you stay within gnupg” - sorry to call them out but they’re quite some ignorant assholes

this can be repeated very easy: use a fido+pgp capable token - register it in your browser with any fido website - use some gpg command accessing the token - switch back to your browser and see how the token is no longer available until replug

tl;dr: just stay away from GnuPG - if you want to use PGP on your token: use other implementations that handle token locking and lock release properly

as for firmware update: I noticed it seem to work best when doing it right after replugging the nitrokey before using it for anything else

also: make sure you have the udev rules installed or execute firmware update as root

2 Likes

None of these suggestions has any effect on my situation, I tested them and they did not resolve the issue. While I understand the frustration I would still prefer to not read insults against people clearly benefitting society a lot.

I will look for other PGP implementations and test, whether that will resolve the issue. It is likely I cannot use them because some of the software I need to use might not have integration for something else.

And yes I set up udev rules. On another device, firmware update works even without root. So it is definitely a software issue on my Ubuntu.

You noticing the devices switch order when the trouble starts is an interesting observation. You could test what happens when you edit as follows

~/gnupg/scdaemon.conf

disable-ccid

pcsc-shared

Reference and take attention to the note here: GnuPG and PC/SC conflicts, episode 3 | Ludovic Rousseau's blog

1 Like

nah, you got me wrong

it’s not PGP as a standard - it has lot of good ideas although barely properly practiced in the real world

the issue is its implementation GnuPG - and it’s not just me to criticize it - if you read “they have to get called out for thier crap” as “insult towards who society(?) benefit from” … well, which society? those handful of crypto-nerds here trying to get thier head around PGP?

if GnuPG wouldn’t be so broken but play by the standard its de-facto implementaiton it became my call out wouldn’t be necessary

also - to quote them: “we wish sequoia to fail” - that’s not just anti-competitive - that’s actively denying a standard by denying other implementaions of said standard - and for this they have to get called out for

I can confirm, that this is really an issue introduced by the GnuPG developers.

They just grab whatever looks like an OpenPGP smart card and break everything else. And they resist to change that. They even refuse to integrate other card implementation, because they want to promote their own OpenPGP card standard. We tried to integrate the SmartCard-HSM, got refused and had do develop our own solution. We even offered to pay them to allow the integration.

Unfortunately the Sequoia guys are not really better.

1 Like

Yes, I got you exactly. I was not questioning your opinion about GPG, I was specifically referring to

being an insult.

You can get your point across better by sticking to the relevant parts of your message.

So there is right now not really any practical alternative to switch to?

Thank you, I had disable-ccid in it, but not pcsc-shared. It seems to resolve the issue for now, but I will wait a bit, as last time it also seemed to be a temporary solution.

Unfortunately it is not resolving the issue. What I have to add to this discussion: I was using it with GnuPG for a little less than a year without any issues. But when I started experiments with the Nitrokey HSM it suddenly stopped working. So even though it seems to be a GnuPG issue, it seems to be a corner case that was triggered by something I did during the HSM tests.

My solution for this problem is to use GitHub - alonbl/gnupg-pkcs11-scd: PKCS#11 GnuPG SCD but not all GnuPG features work.

1 Like

As I couldn’t find a satisfying solution, I will stick with the workaround whenever the Nitrokey’s smart card stops being available:

sudo systemctl stop pcscd
gpg-connect-agent "SCD KILLSCD" /bye
sudo apt remove -y scdaemon pcscd
sudo apt install -y scdaemon pcscd
gpg-connect-agent "SCD KILLSCD" /bye

Too bad it did not help. Two other things to try:

  1. the Broadcom device you noticed will be an integrated smartcard/NFC reader in the laptop. If you don’t need it for the time being, it can be blacklisted.
  2. I don’t think it’s necessary to uninstall packages. pcscd is triggered again by pcscd.socket; stopping both, then killing active processes should suffice.