Prefix crlNumber output with 0x.
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>
Mon, 13 Jul 2020 22:04:04 +0000 (15:04 -0700)
committerPauli <paul.dale@oracle.com>
Tue, 20 Oct 2020 07:27:42 +0000 (17:27 +1000)
When the crlNumber field contains only 0-9 digits, the output is
ambiguous as to what base it's in, which can be confusing. Adding this
prefix makes it explicit that it's in hex.

CLA: trivial

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12434)

apps/crl.c

index d417642ccead5fe06c2ed8cb9fdd178b02a910ff..4cb1bcc2c33533e1aa94f775693c663c594b9a8f 100644 (file)
@@ -288,6 +288,7 @@ int crl_main(int argc, char **argv)
                 crlnum = X509_CRL_get_ext_d2i(x, NID_crl_number, NULL, NULL);
                 BIO_printf(bio_out, "crlNumber=");
                 if (crlnum) {
+                    BIO_puts(bio_out, "0x");
                     i2a_ASN1_INTEGER(bio_out, crlnum);
                     ASN1_INTEGER_free(crlnum);
                 } else