summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-05-06 11:35:02 +0200
committerWerner Koch <wk@gnupg.org>2022-05-06 11:39:30 +0200
commit6f612fd5f6d884bbc4645d55378d6ee01942109f (patch)
tree444c8a5990467ddf721a4260965d3a3dcd5ac32b
parent054d14887ef8fa1cbadef4ed2ea28213f25f5d25 (diff)
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
-rw-r--r--scd/app-p15.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/scd/app-p15.c b/scd/app-p15.c
index 377879142..fc136b9fb 100644
--- a/scd/app-p15.c
+++ b/scd/app-p15.c
@@ -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;
@@ -5003,7 +5003,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;