diff --git a/apps/x509.c b/apps/x509.c index 67a70e7fea8b2b..9fdc0afb69e955 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -590,7 +590,7 @@ 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))) + if (reqfile && !X509_set_issuer_name(x, X509_get_subject_name(xca))) goto end; }