summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2021-03-11 14:43:04 -0500
committerTomas Mraz <tomas@openssl.org>2021-04-28 11:40:06 +0200
commitcdf63a3736a91a534bd3bc952b1dc3ef714604dd (patch)
treef1c2986418c09bd6a8933d024475ede09f44c687 /apps/ca.c
parentd97adfda2868aeb9e62df96216203e8120a95d6d (diff)
Add X509 version constants.
The X509 version APIs return the numerical values of the version numbers, which are one off from the names. This is a bit confusing. Where they don't get it wrong (accidentally making an "X509v4" certificate), callers tend to try commenting every call site to explain the mismatch, including in OpenSSL itself. Define constants for these values, so code can be self-documenting and callers are nudged towards the right values. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14549)
Diffstat (limited to 'apps/ca.c')
-rwxr-xr-xapps/ca.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 6c1df8d2e3..2476343fdd 100755
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1255,8 +1255,8 @@ end_of_options:
}
}
if (crl_ext != NULL || crl_v2) {
- if (!X509_CRL_set_version(crl, 1))
- goto end; /* version 2 CRL */
+ if (!X509_CRL_set_version(crl, X509_CRL_VERSION_2))
+ goto end;
}
/* we have a CRL number that need updating */