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
1 changed files with 6 additions and 2 deletions

View File

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