From: Richard Levitte Date: Mon, 28 Sep 2020 19:29:56 +0000 (+0200) Subject: APPS: Modify 'fipsinstall' to output all notifications on stderr X-Git-Tag: openssl-3.0.0-alpha13~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9d74dbd3676603a257cedcdcbd720a3a9a775a5;p=thirdparty%2Fopenssl.git APPS: Modify 'fipsinstall' to output all notifications on stderr The actual output of the 'fipsinstall' is the config file it outputs. It should be possible to output that to standard output, and diverse notification messages shouldn't be mixed in. Therefore, we output them to standard error instead. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14320) --- diff --git a/apps/fipsinstall.c b/apps/fipsinstall.c index ade983169ba..9aaa7522d23 100644 --- a/apps/fipsinstall.c +++ b/apps/fipsinstall.c @@ -384,7 +384,7 @@ opthelp: if (verify_module_load(parent_config)) { ret = OSSL_PROVIDER_available(NULL, prov_name) ? 0 : 1; if (!quiet) - BIO_printf(bio_out, "FIPS provider is %s\n", + BIO_printf(bio_err, "FIPS provider is %s\n", ret == 0 ? "available" : " not available"); } goto end; @@ -478,7 +478,7 @@ opthelp: install_mac, install_mac_len)) goto end; if (!quiet) - BIO_printf(bio_out, "VERIFY PASSED\n"); + BIO_printf(bio_err, "VERIFY PASSED\n"); } else { conf = generate_config_and_load(prov_name, section_name, module_mac, @@ -502,7 +502,7 @@ opthelp: install_mac, install_mac_len)) goto end; if (!quiet) - BIO_printf(bio_out, "INSTALL PASSED\n"); + BIO_printf(bio_err, "INSTALL PASSED\n"); } ret = 0; @@ -550,10 +550,10 @@ static int self_test_events(const OSSL_PARAM params[], void *arg) if (self_test_log) { if (strcmp(phase, OSSL_SELF_TEST_PHASE_START) == 0) - BIO_printf(bio_out, "%s : (%s) : ", desc, type); + BIO_printf(bio_err, "%s : (%s) : ", desc, type); else if (strcmp(phase, OSSL_SELF_TEST_PHASE_PASS) == 0 || strcmp(phase, OSSL_SELF_TEST_PHASE_FAIL) == 0) - BIO_printf(bio_out, "%s\n", phase); + BIO_printf(bio_err, "%s\n", phase); } /* * The self test code will internally corrupt the KAT test result if an @@ -568,7 +568,7 @@ static int self_test_events(const OSSL_PARAM params[], void *arg) if (self_test_corrupt_type != NULL && strcmp(self_test_corrupt_type, type) != 0) goto end; - BIO_printf(bio_out, "%s ", phase); + BIO_printf(bio_err, "%s ", phase); goto err; } end: