diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2023-09-08 10:33:24 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2023-09-09 16:44:33 +0200 |
commit | d2873946dfaff5537ea3d1adf3890e33a3f276ff (patch) | |
tree | 9361aa662416aceb12bc656de827bd04f510bc03 /apps | |
parent | aff99225f946d8f538b5e0cb95fc65d5cd36b99b (diff) |
Fix output corruption in req command
when used in conjunction with -out and -modulus options.
Fixes #21403
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22026)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/req.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/req.c b/apps/req.c index e65bdad9b6..c4c9ba292c 100644 --- a/apps/req.c +++ b/apps/req.c @@ -973,10 +973,10 @@ int req_main(int argc, char **argv) else tpubkey = X509_REQ_get0_pubkey(req); if (tpubkey == NULL) { - fprintf(stdout, "Modulus is unavailable\n"); + BIO_puts(bio_err, "Modulus is unavailable\n"); goto end; } - fprintf(stdout, "Modulus="); + BIO_puts(out, "Modulus="); if (EVP_PKEY_is_a(tpubkey, "RSA") || EVP_PKEY_is_a(tpubkey, "RSA-PSS")) { BIGNUM *n = NULL; @@ -985,9 +985,9 @@ int req_main(int argc, char **argv) BN_print(out, n); BN_free(n); } else { - fprintf(stdout, "Wrong Algorithm type"); + BIO_puts(out, "Wrong Algorithm type"); } - fprintf(stdout, "\n"); + BIO_puts(out, "\n"); } if (!noout && !gen_x509) { |