From: Matt Caswell Date: Fri, 11 Apr 2025 13:21:48 +0000 (+0100) Subject: Add a test for calling SSL_accept() on a listener X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b637fbe781ab40afca700a44fa78b8748f5892dd;p=thirdparty%2Fopenssl.git Add a test for calling SSL_accept() on a listener 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) --- 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);