]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC TSERVER: Fix probable nondeterminism in some OS network stacks
authorHugo Landau <hlandau@openssl.org>
Thu, 5 Jan 2023 10:51:14 +0000 (10:51 +0000)
committerHugo Landau <hlandau@openssl.org>
Fri, 27 Jan 2023 14:19:15 +0000 (14:19 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19897)

test/quic_tserver_test.c

index c6c5c719e972e06b9c368764762d289b813edfda..e743adbeab41ecd1caa45a645a4bffa144a56f25 100644 (file)
@@ -214,11 +214,18 @@ static int test_tserver(void)
             if (!TEST_false(ret))
                 goto err;
 
-            if (!TEST_int_eq(SSL_get_error(c_ssl, ret), SSL_ERROR_ZERO_RETURN))
-                goto err;
+            /*
+             * Allow the implementation to take as long as it wants to finally
+             * notice EOS. Account for varied timings in OS networking stacks.
+             */
+            if (SSL_get_error(c_ssl, ret) != SSL_ERROR_WANT_READ) {
+                if (!TEST_int_eq(SSL_get_error(c_ssl, ret),
+                                 SSL_ERROR_ZERO_RETURN))
+                    goto err;
 
-            /* DONE */
-            break;
+                /* DONE */
+                break;
+            }
         }
 
         /*