[PATCH gnupg] scd: Add Nitrokey 3 to pcsc-shared interference detection

NIIBE Yutaka gniibe at fsij.org
Tue Jun 30 06:34:29 CEST 2026


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 at https://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++)
==========================
-- 



More information about the Gnupg-devel mailing list