]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add a test for calling SSL_accept() on a listener
authorMatt Caswell <matt@openssl.org>
Fri, 11 Apr 2025 13:21:48 +0000 (14:21 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 24 Apr 2025 18:10:44 +0000 (20:10 +0200)
We expect this scenario to fail

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27351)

test/quicapitest.c

index 25b7d242cf327e5ef50fefa35ff224591e4b82e4..a8d803501c67b938f9d5e59361209a7165c1e232 100644 (file)
@@ -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);