summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDaniel Fiala <daniel@openssl.org>2022-04-18 11:30:13 +0200
committerTomas Mraz <tomas@openssl.org>2022-04-25 14:02:14 +0200
commit91db522f31981b3fafdec4120de1027e8bc4d792 (patch)
tree8c305d2568d0426b7e06ff00917ac165dc918146 /apps
parent564a8d442cbd8ce68d452ff2e8a58c0aea6b0632 (diff)
x509: use actual issuer name if a CA is used
Fixes openssl#16080. Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18129)
Diffstat (limited to 'apps')
-rw-r--r--apps/x509.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/x509.c b/apps/x509.c
index 1043eba0c8..2329d9b2d4 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -590,6 +590,8 @@ int x509_main(int argc, char **argv)
xca = load_cert(CAfile, CAformat, "CA Certificate");
if (xca == NULL)
goto end;
+ if (!X509_set_issuer_name(x, X509_get_subject_name(xca)))
+ goto end;
}
out = bio_open_default(outfile, 'w', outformat);
@@ -987,8 +989,6 @@ static int x509_certify(X509_STORE *ctx, const char *CAfile, const EVP_MD *diges
goto end;
}
- if (!X509_set_issuer_name(x, X509_get_subject_name(xca)))
- goto end;
if (!X509_set_serialNumber(x, bs))
goto end;