Fix test failure in 30-test_evp_pkey_provided.t

In this test there is a random test output corruption.
`make test TESTS=test_evp_pkey_provided V=1` has some random output,
that can with a certain probability start a line with "ok" or so:

    # Setting up a OSSL_ENCODER context with passphrase
    # Testing with no encryption
jLixONcRPi/m64CGie4KKKDuGeTjtYwfima3BNYCGlgbLGeK3yYxBfZb9JjviOJ4
    # nHaNsRsONTAKyg==

This happens because large random data is output to bio_out
but some data remains buffered, and then test_note() is used to print
some comments on the bio_err file.  This causes output corruption that
confuses the TAP parser.
Fix that by flushing any pending output with test_flush_stdout() first.

Fixes #23992

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26383)
This commit is contained in:
Bernd Edlinger 2025-01-10 19:58:46 +01:00 committed by Tomas Mraz
parent 92c242e8ac
commit c37f564bb8

View file

@ -145,6 +145,7 @@ void test_perror(const char *s)
void test_note(const char *fmt, ...)
{
test_flush_stdout();
if (fmt != NULL) {
va_list ap;