summaryrefslogtreecommitdiffstats
path: root/apps/x509.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-12-04 11:01:08 +0100
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-12-10 15:19:55 +0100
commitd858e743a9efa9d6282fdb84f3160b485bafc866 (patch)
tree4059e9d83119ad7b8787e429d4f690b4a3fafae2 /apps/x509.c
parente9701a0141313d2c7008c6ee6d821ba80b3a14d9 (diff)
apps/{req,x509,ca}.c: Clean up code setting X.509 cert version v3
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13614)
Diffstat (limited to 'apps/x509.c')
-rw-r--r--apps/x509.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/x509.c b/apps/x509.c
index ad627f4558..303d197569 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -1034,7 +1034,7 @@ static int x509_certify(X509_STORE *ctx, const char *CAfile, const EVP_MD *diges
if (conf != NULL) {
X509V3_CTX ctx2;
- X509_set_version(x, 2); /* version 3 certificate */
+
X509V3_set_ctx(&ctx2, xca, x, NULL, NULL, 0);
X509V3_set_nconf(&ctx2, conf);
if (!X509V3_EXT_add_nconf(conf, &ctx2, section, x))
@@ -1105,7 +1105,7 @@ static int sign(X509 *x, EVP_PKEY *pkey, EVP_PKEY *fkey,
}
if (conf != NULL) {
X509V3_CTX ctx;
- X509_set_version(x, 2); /* version 3 certificate */
+
X509V3_set_ctx(&ctx, x, x, NULL, NULL, 0);
X509V3_set_nconf(&ctx, conf);
if (!X509V3_EXT_add_nconf(conf, &ctx, section, x))