diff options
author | Tomas Mraz <tmraz@fedoraproject.org> | 2017-05-11 14:25:17 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-05-11 17:18:16 +0200 |
commit | 888adbe064556ff5ab2f1d16a223b0548696614c (patch) | |
tree | 7357e524ac53eb540e6d3de84a8392996570c9df /apps | |
parent | 3f97052392cb10fca5309212bf720685262ad4a6 (diff) |
Fix regression in openssl req -x509 behaviour.
Allow conversion of existing requests to certificates again.
Fixes the issue #3396
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3437)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/req.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/req.c b/apps/req.c index f1dba66041..a47dfcffaf 100644 --- a/apps/req.c +++ b/apps/req.c @@ -288,7 +288,6 @@ int req_main(int argc, char **argv) break; case OPT_X509: x509 = 1; - newreq = 1; break; case OPT_DAYS: days = atoi(opt_arg()); @@ -331,6 +330,9 @@ int req_main(int argc, char **argv) if (argc != 0) goto opthelp; + if (x509 && infile == NULL) + newreq = 1; + /* TODO: simplify this as pkey is still always NULL here */ private = newreq && (pkey == NULL) ? 1 : 0; @@ -582,7 +584,7 @@ int req_main(int argc, char **argv) } } - if (newreq) { + if (newreq || x509) { if (pkey == NULL) { BIO_printf(bio_err, "you need to specify a private key\n"); goto end; |