Commit 495cf0efe6 for openssl.org

commit 495cf0efe6c536e60bf63f666c684e43675b99fd
Author: Tomas Mraz <tomas@openssl.org>
Date:   Mon Dec 15 12:19:30 2025 +0100

    apps/req.c: Always set permissions for private key output

    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)

diff --git a/apps/req.c b/apps/req.c
index f95fa013bd..3171342d85 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -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;