]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Tserver must keep fake time ticking to complete a handshake
authorsashan <anedvedicky@gmail.com>
Fri, 21 Feb 2025 01:04:03 +0000 (02:04 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 25 Feb 2025 14:34:24 +0000 (15:34 +0100)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

test/quic_tserver_test.c

index 0b91e2f52449326f184e9647119a2dabd6971416..0edd74bbcbf5891a684e1914be5cd4cedbd1fba2 100644 (file)
@@ -211,8 +211,21 @@ static int do_test(int use_thread_assist, int use_fake_time, int use_inject)
             if (!TEST_true(ret == 1 || is_want(c_ssl, ret)))
                 goto err;
 
-            if (ret == 1)
+            if (ret == 1) {
                 c_connected = 1;
+            } else {
+                /*
+                 * keep timer ticking to keep handshake running.
+                 * The timer is important for calculation of ping deadline.
+                 * If things stall for whatever reason we at least send
+                 * ACK eliciting ping to let peer know we are here ready
+                 * to hear back.
+                 */
+                if (!TEST_true(CRYPTO_THREAD_write_lock(fake_time_lock)))
+                    goto err;
+                fake_time = ossl_time_add(fake_time, ossl_ms2time(100));
+                CRYPTO_THREAD_unlock(fake_time_lock);
+            }
         }
 
         if (c_connected && !c_write_done) {