[PATCH gnupg] scd: Add Nitrokey 3 to pcsc-shared interference detection
Artemii Bigdan
artem at bigdan.in
Tue Jun 30 20:02:34 CEST 2026
Hello,
I gave your suggestion a try. I applied your little patch to the current
master branch.
Unfortunately, it did not achieve the desired bugfix. The `gpg: OpenPGP
card not available: Card error` is back after KeePassXC interference, as
before.
I tried several different combinations of fixes based around yours; none
yielded satisfactory results.
It seems that, as Robin Krahl <robin at nitrokey.com> noted, there are
other CARDTYPE_YUBIKEY workarounds scattered around the codebase.
Unfortunately, my free time is rather limited, so the specific root
cause is yet to be determined.
Still, it seems plausible to me that some Yubikey-specific workaround
interferes, given that the original patch with a separate CARDTYPE_NK3
enum works flawlessly.
While I understand you want a minimal change to reduce the maintenance
burden, I agree with Robin that it would be wise to create a new enum
value for Nitrokey 3. Nitrokey is not developed or marketed as a Yubikey
clone. And while I understand that Nitrokey is a rather niche platform,
it is one of the more popular fully free-software alternatives to
Yubikey currently on the market.
So, as of my testing, I unfortunately have to insist on the
`0025-scdaemon-nitrokey3-pcsc-shared.patch` as it was submitted earlier.
I am open to perform more tests if you can come up with a more concise
way to achieve the same result.
I would also like to ask Robin and NIIBE Yutaka: maybe Nitrokey and
GnuPG could cooperate and deliver an R&D Nitrokey 3 device to one of
GnuPG's core maintainers for better first-class support?
Thank you for your time and attention to this issue. It means a lot,
this bug has bothered me constantly in my daily workflow, and I really
do not want to manually re-patch each update. I hope we can upstream this.
- Artemii
On 6/30/26 6:34 AM, NIIBE Yutaka wrote:
> Hello,
>
> I register your DCO. Then, I found a mistake in the code and pushed:
>
> ca25a7a61bebbe4e27dd5568c5b049675b7aa4ae
>
> Artemii Bigdan<artem at bigdan.in> wrote:
>> I do not have documentation from Nitrokey on the CCID behavior of the
>> device. The observations below are from testing. More information
>> about the hardware can be found athttps://www.nitrokey.com
> Ummm... So, all might be guess work (unfortunately, I don't have the
> device).
>
> In this situation, simpler changes are better. If it's mostly the same
> (feature-wise), how about something like the following patch? If it
> works somehow, I think that it is good for our maintenance reason.
>
> ==========================
> diff --git a/scd/app.c b/scd/app.c
> index 63eb84190..bbd10d6e7 100644
> --- a/scd/app.c
> +++ b/scd/app.c
> @@ -667,6 +667,12 @@ atr_to_cardtype (int slot, const unsigned char *atr, size_t atrlen)
> if (!atrbuf)
> return 0;
> atr = atrbuf;
> + if (atrlen >= 16 && !memcmp (&atr[5], "Nitrokey", 8))
> + {
> + /* It looks like Yubikey variant/clone. */
> + xfree (atrbuf);
> + return CARDTYPE_YUBIKEY;
> + }
> }
>
> for (i=0; atrlist[i].atrlen; i++)
> ==========================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20260630/f1d0c507/attachment.sig>
More information about the Gnupg-devel
mailing list