summaryrefslogtreecommitdiffstats
path: root/apps/req.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-08-22 14:53:53 +0200
committerRichard Levitte <levitte@openssl.org>2016-08-22 15:28:00 +0200
commit599e5904b22f3d50c5f4720aa3bc8ab8af0ffa98 (patch)
tree13e4067f78ea516aa6c1da2602f0f58e9fb66f82 /apps/req.c
parent3ba1ef829cf3dd36eaa5e819258d90291c6a1027 (diff)
Make 'openssl req -x509' more equivalent to 'openssl req -new'
The following would fail, or rather, freeze: openssl genrsa -out rsa2048.pem 2048 openssl req -x509 -key rsa2048.pem -keyform PEM -out cert.pem In that case, the second command wants to read a certificate request from stdin, because -x509 wasn't fully flagged as being for creating something new. This changes makes it fully flagged. RT#4655 Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'apps/req.c')
-rw-r--r--apps/req.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/req.c b/apps/req.c
index bd18708e3a..2666124546 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -289,6 +289,7 @@ int req_main(int argc, char **argv)
break;
case OPT_X509:
x509 = 1;
+ newreq = 1;
break;
case OPT_DAYS:
days = atoi(opt_arg());
@@ -578,7 +579,7 @@ int req_main(int argc, char **argv)
}
}
- if (newreq || x509) {
+ if (newreq) {
if (pkey == NULL) {
BIO_printf(bio_err, "you need to specify a private key\n");
goto end;