mirror of
https://github.com/openssl/openssl.git
synced 2024-12-18 06:23:58 +08:00
Print the X509 version signed, and convert to unsigned for the hex version.
Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1754
This commit is contained in:
parent
d95743047e
commit
676befbeb7
@ -71,8 +71,13 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
|
||||
}
|
||||
if (!(cflag & X509_FLAG_NO_VERSION)) {
|
||||
l = X509_get_version(x);
|
||||
if (BIO_printf(bp, "%8sVersion: %lu (0x%lx)\n", "", l + 1, l) <= 0)
|
||||
goto err;
|
||||
if (l >= 0 && l <= 2) {
|
||||
if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, (unsigned long)l) <= 0)
|
||||
goto err;
|
||||
} else {
|
||||
if (BIO_printf(bp, "%8sVersion: Unknown (%ld)\n", "", l) <= 0)
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
if (!(cflag & X509_FLAG_NO_SERIAL)) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user