]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Try to fix endless loops in quic_multistream_test
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 23 Mar 2025 14:20:34 +0000 (15:20 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 24 Mar 2025 19:22:17 +0000 (20:22 +0100)
The problem seem to be caused by syntax errors due to injected
OSSL_QUIC_FRAME_TYPE_PATH_CHALLENGE packets which are too short
by 8 bytes.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27089)

(cherry picked from commit ad684e1a6a925c7fbadad7d309f0204f49e67105)

test/quic_multistream_test.c

index 9fac202abecc1a160214fb4ce4e9b735a1fd301f..35b709eca1463aea0344a47a3869fd7af8bf403b 100644 (file)
@@ -2822,7 +2822,7 @@ static int script_21_inject_plain(struct helper *h, QUIC_PKT_HDR *hdr,
 {
     int ok = 0;
     WPACKET wpkt;
-    unsigned char frame_buf[8];
+    unsigned char frame_buf[9];
     size_t written;
 
     if (h->inject_word0 == 0 || hdr->type != h->inject_word0)
@@ -2835,6 +2835,19 @@ static int script_21_inject_plain(struct helper *h, QUIC_PKT_HDR *hdr,
     if (!TEST_true(WPACKET_quic_write_vlint(&wpkt, h->inject_word1)))
         goto err;
 
+    switch (h->inject_word1) {
+    case OSSL_QUIC_FRAME_TYPE_PATH_CHALLENGE:
+        if (!TEST_true(WPACKET_put_bytes_u64(&wpkt, (uint64_t)0)))
+            goto err;
+        break;
+    case OSSL_QUIC_FRAME_TYPE_STREAM_DATA_BLOCKED:
+        if (!TEST_true(WPACKET_quic_write_vlint(&wpkt, (uint64_t)0)))
+            goto err;
+        if (!TEST_true(WPACKET_quic_write_vlint(&wpkt, (uint64_t)0)))
+            goto err;
+        break;
+    }
+
     if (!TEST_true(WPACKET_get_total_written(&wpkt, &written)))
         goto err;