From 08cc34911470fbf8f96cb49258481dbb00d1128e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 14 Mar 2023 11:25:48 +0100 Subject: [PATCH] gpg: Allow no version information of Yubikey * g10/call-agent.c (learn_status_cb): Set is_v2 always for Yubikeys. -- GnuPG-bug-id: 5100, 6378 Backported-from-master: 1cd615afe3010d2c3919de489d7c9a78513c8694 --- g10/call-agent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/g10/call-agent.c b/g10/call-agent.c index 7e60542ef..abd6eb34d 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -525,7 +525,8 @@ learn_status_cb (void *opaque, const char *line) xfree (parm->serialno); parm->serialno = store_serialno (line); parm->is_v2 = (strlen (parm->serialno) >= 16 - && xtoi_2 (parm->serialno+12) >= 2 ); + && (xtoi_2 (parm->serialno+12) == 0 /* Yubikey */ + || xtoi_2 (parm->serialno+12) >= 2)); } else if (keywordlen == 7 && !memcmp (keyword, "APPTYPE", keywordlen)) {