diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-29 20:15:50 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-29 20:15:50 +0200 |
commit | 2fa45e6ee722078bc55311c66bdba1ca2fc69c28 (patch) | |
tree | 5e5b00a8d117bcb9e4acee3ce614ff98100f8430 /apps/ca.c | |
parent | Remove needless bio_err argument (diff) | |
download | openssl-2fa45e6ee722078bc55311c66bdba1ca2fc69c28.tar.xz openssl-2fa45e6ee722078bc55311c66bdba1ca2fc69c28.zip |
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) { |