From 6b3fa7461193c660c8f1a1e557a53ea965e47ab4 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 11 Apr 2025 14:21:48 +0100 Subject: [PATCH] Add a test for calling SSL_accept() on a listener MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We expect this scenario to fail Reviewed-by: Saša Nedvědický Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27351) (cherry picked from commit b637fbe781ab40afca700a44fa78b8748f5892dd) --- test/quicapitest.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/quicapitest.c b/test/quicapitest.c index 25b7d242cf3..a8d803501c6 100644 --- a/test/quicapitest.c +++ b/test/quicapitest.c @@ -2770,6 +2770,12 @@ static int test_ssl_accept_connection(void) if (!create_quic_ssl_objects(sctx, cctx, &qlistener, &clientssl)) goto err; + /* Calling SSL_accept() on a listener is expected to fail */ + ret = SSL_accept(qlistener); + if (!TEST_int_le(ret, 0) + || !TEST_int_eq(SSL_get_error(qlistener, ret), SSL_ERROR_SSL)) + goto err; + /* Send ClientHello and server retry */ for (i = 0; i < 2; i++) { ret = SSL_connect(clientssl); -- 2.47.2