X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=apps%2Fca.c;h=9c9641725802ee23cc8098b6a2f2e1d5364488cb;hp=ba666eef72666cd8e12784d81b7ca7a51bb94450;hb=2fa45e6ee722078bc55311c66bdba1ca2fc69c28;hpb=ecf3a1fb181c08540342cceb6549e0408b32d135 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) {