]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps/req.c: Always set permissions for private key output
authorTomas Mraz <tomas@openssl.org>
Mon, 15 Dec 2025 11:19:30 +0000 (12:19 +0100)
committerNorbert Pocs <norbertp@openssl.org>
Wed, 17 Dec 2025 12:47:29 +0000 (13:47 +0100)
The key output will be always private.

Reported with a proposed fix by Stanislav Fort (Aisle Research).

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/29397)

apps/req.c

index f95fa013bd91fa0287289a668ce37d498e4450ca..3171342d85372204d2d6392981450db4397be4b2 100644 (file)
@@ -719,7 +719,7 @@ int req_main(int argc, char **argv)
             else
                 BIO_printf(bio_err, "'%s'\n", keyout);
         }
-        out = bio_open_owner(keyout, outformat, newreq);
+        out = bio_open_owner(keyout, outformat, 1);
         if (out == NULL)
             goto end;