diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-08-27 11:34:23 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-11-08 12:50:42 +0100 |
commit | f6d4ab9295a173c81e6fe4185ec62533d91b0c6d (patch) | |
tree | dab31ff7fbdb53c38fa7270bc1d6abbd7237891e /apps/x509.c | |
parent | a075c882641782a6ee94a9123c72b47891a8cf28 (diff) |
APPS/x509: Fix generation of AKID via v2i_AUTHORITY_KEYID()
Fixes #16300
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16442)
(cherry picked from commit 9bf1061c44c81059102cd4749f6078b6ce71da9d)
Diffstat (limited to 'apps/x509.c')
-rw-r--r-- | apps/x509.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/x509.c b/apps/x509.c index 203ce919ba..2880ae792a 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -816,7 +816,12 @@ int x509_main(int argc, char **argv) goto end; } - X509V3_set_ctx(&ext_ctx, issuer_cert, x, req, NULL, X509V3_CTX_REPLACE); + X509V3_set_ctx(&ext_ctx, issuer_cert, x, NULL, NULL, X509V3_CTX_REPLACE); + /* prepare fallback for AKID, but only if issuer cert equals subject cert */ + if (CAfile == NULL) { + if (!X509V3_set_issuer_pkey(&ext_ctx, privkey)) + goto end; + } if (extconf != NULL && !x509toreq) { X509V3_set_nconf(&ext_ctx, extconf); if (!X509V3_EXT_add_nconf(extconf, &ext_ctx, extsect, x)) { |