summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-29 20:15:50 +0200
committerRich Salz <rsalz@openssl.org>2015-04-29 20:15:50 +0200
commit2fa45e6ee722078bc55311c66bdba1ca2fc69c28 (patch)
tree5e5b00a8d117bcb9e4acee3ce614ff98100f8430 /apps/ca.c
parentRemove needless bio_err argument (diff)
downloadopenssl-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.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/apps/ca.c b/apps/ca.c
index ba666eef72..9c96417258 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -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) {