The branch master has been updated
       via  599e5904b22f3d50c5f4720aa3bc8ab8af0ffa98 (commit)
      from  3ba1ef829cf3dd36eaa5e819258d90291c6a1027 (commit)


- Log -----------------------------------------------------------------
commit 599e5904b22f3d50c5f4720aa3bc8ab8af0ffa98
Author: Richard Levitte <levi...@openssl.org>
Date:   Mon Aug 22 14:53:53 2016 +0200

    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 <ap...@openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 apps/req.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/req.c b/apps/req.c
index bd18708..2666124 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;
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to