diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-29 14:15:50 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-29 14:15:50 -0400 |
commit | 2fa45e6ee722078bc55311c66bdba1ca2fc69c28 (patch) | |
tree | 5e5b00a8d117bcb9e4acee3ce614ff98100f8430 /apps/ca.c | |
parent | ecf3a1fb181c08540342cceb6549e0408b32d135 (diff) |
use isxdigit and apps_tohex
Replace ad-hoc ascii->hex with isxdigit and new app_tohex.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'apps/ca.c')
-rw-r--r-- | apps/ca.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -778,16 +778,13 @@ end_of_options: i + 1, j); goto end; } - while (*p) { - if (!(((*p >= '0') && (*p <= '9')) || - ((*p >= 'A') && (*p <= 'F')) || - ((*p >= 'a') && (*p <= 'f')))) { + for ( ; *p; p++) { + if (!isxdigit(*p)) { BIO_printf(bio_err, - "entry %d: bad serial number characters, char pos %ld, char is '%c'\n", - i + 1, (long)(p - pp[DB_serial]), *p); + "entry %d: bad char 0%o '%c' in serial number\n", + i + 1, *p, *p); goto end; } - p++; } } if (verbose) { |