Correct ssl_old_test stream handling
authorMatt Caswell <matt@openssl.org>
Wed, 3 Jan 2024 09:43:16 +0000 (09:43 +0000)
committerTomas Mraz <tomas@openssl.org>
Fri, 5 Jan 2024 11:13:19 +0000 (12:13 +0100)
commit2995be50e8c2f2ef907866e35347be1e200558a2
treed515f342cc3272040e366e48685fc0cbf5dca8a9
parent3348713ad390372ba5a0a0f98b46b2f637475e47
Correct ssl_old_test stream handling

The ssl_old_test has not been fully converted to the test framework but
it still reuses some test framework utilities. Notably it was creating
it's own copy of the global bio_err object directly (which is normally
created and owned by the test framework). This causes a problem because
ever since commit 2fa9044 access to the bio_err object is controlled by
a lock. Since ssl_old_test was circumventing the normal creation and
destruction of bio_err, the lock was not being created resulting in a
crash under certain error conditions.

We fix this by creating and destroying the bio_err object using the
test framework functions designed for that purpose.

Fixes #23184

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23187)
test/ssl_old_test.c