1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

gpg: Fix --card-status to handle lowercase APPTYPEs

* g10/card-util.c (current_card_status): Use ascii_strcasecmp.
This commit is contained in:
Werner Koch 2022-08-16 11:21:39 +02:00
parent 7046001b07
commit 287597cb22
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -410,29 +410,29 @@ current_card_status (ctrl_t ctrl, estream_t fp,
|| strlen (info.serialno) != 32 ) || strlen (info.serialno) != 32 )
{ {
const char *name1, *name2; const char *name1, *name2;
if (info.apptype && !strcmp (info.apptype, "openpgp")) if (info.apptype && !ascii_strcasecmp (info.apptype, "openpgp"))
goto openpgp; goto openpgp;
else if (info.apptype && !strcmp (info.apptype, "NKS")) else if (info.apptype && !ascii_strcasecmp (info.apptype, "NKS"))
{ {
name1 = "netkey"; name1 = "netkey";
name2 = "NetKey"; name2 = "NetKey";
} }
else if (info.apptype && !strcmp (info.apptype, "DINSIG")) else if (info.apptype && !ascii_strcasecmp (info.apptype, "DINSIG"))
{ {
name1 = "dinsig"; name1 = "dinsig";
name2 = "DINSIG"; name2 = "DINSIG";
} }
else if (info.apptype && !strcmp (info.apptype, "P15")) else if (info.apptype && !ascii_strcasecmp (info.apptype, "P15"))
{ {
name1 = "pkcs15"; name1 = "pkcs15";
name2 = "PKCS#15"; name2 = "PKCS#15";
} }
else if (info.apptype && !strcmp (info.apptype, "GELDKARTE")) else if (info.apptype && !ascii_strcasecmp (info.apptype, "GELDKARTE"))
{ {
name1 = "geldkarte"; name1 = "geldkarte";
name2 = "Geldkarte"; name2 = "Geldkarte";
} }
else if (info.apptype && !strcmp (info.apptype, "PIV")) else if (info.apptype && !ascii_strcasecmp (info.apptype, "PIV"))
{ {
name1 = "piv"; name1 = "piv";
name2 = "PIV"; name2 = "PIV";