aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2022-05-06 09:35:02 +0000
committerWerner Koch <[email protected]>2022-05-06 09:35:02 +0000
commit8efe738c4a090f523461fa3055da668467715105 (patch)
tree2ac9467f23d007a94646f7202416f40af78c2cdb
parentscd:p15: Fix reading certificates without length info. (diff)
downloadgnupg-8efe738c4a090f523461fa3055da668467715105.tar.gz
gnupg-8efe738c4a090f523461fa3055da668467715105.zip
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 404a01b82..8ede6c05e 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;
@@ -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;