1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

scd:p15: Fix the the sanity check of the displayed S/N.

* scd/app-p15.c (any_control_or_space): Fix loop.
--

This check is only done to avoid printing wrongly encoded S/N for
human consumption.
e
This commit is contained in:
Werner Koch 2022-05-06 11:35:02 +02:00
parent 7f029eef6c
commit 8efe738c4a
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -481,7 +481,7 @@ struct app_local_s
unsigned short auth_objects; unsigned short auth_objects;
} odf; } odf;
/* The PKCS#15 serialnumber from EF(TokeiNFo) or NULL. Malloced. */ /* The PKCS#15 serialnumber from EF(TokenInfo) or NULL. Malloced. */
unsigned char *serialno; unsigned char *serialno;
size_t serialnolen; size_t serialnolen;
@ -4999,7 +4999,11 @@ any_control_or_space (const char *string)
{ {
const unsigned char *s; const unsigned char *s;
for (s = string; *string; string++) for (s = string; *s; s++)
if (*s <= 0x20 || *s >= 0x7f)
return 1;
return 0;
}
if (*s <= 0x20 || *s >= 0x7f) if (*s <= 0x20 || *s >= 0x7f)
return 1; return 1;
return 0; return 0;