Commit a1255dc455 for openssl.org
commit a1255dc455cc212177c71444d9ad130478c8225c
Author: Andrew Dinh <andrewd@openssl.org>
Date: Wed Jul 8 14:37:18 2026 +0700
Port script_24
Assisted-by: Codex:gpt-5.5
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
MergeDate: Thu Jul 30 06:12:44 2026
(Merged from https://github.com/openssl/openssl/pull/32003)
diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c
index 92b9098375..611ced1501 100644
--- a/test/quic_multistream_test.c
+++ b/test/quic_multistream_test.c
@@ -2248,20 +2248,7 @@ err:
}
static const struct script_op script_24[] = {
- OP_S_SET_INJECT_PLAIN(script_24_inject_plain),
- OP_C_SET_ALPN("ossltest"),
- OP_C_CONNECT_WAIT(),
-
- OP_C_WRITE(DEFAULT, "apple", 5),
- OP_S_BIND_STREAM_ID(a, C_BIDI_ID(0)),
- OP_S_READ_EXPECT(a, "apple", 5),
-
- OP_SET_INJECT_WORD(1, OSSL_QUIC_FRAME_TYPE_MAX_STREAMS_BIDI),
-
- OP_S_WRITE(a, "orange", 6),
-
- OP_C_EXPECT_CONN_CLOSE_INFO(OSSL_QUIC_ERR_FRAME_ENCODING_ERROR, 0, 0),
-
+ /* test moved to test/radix/quic_tests.c */
OP_END
};
diff --git a/test/radix/quic_tests.c b/test/radix/quic_tests.c
index efb83f2b77..fd12c6a543 100644
--- a/test/radix/quic_tests.c
+++ b/test/radix/quic_tests.c
@@ -1924,8 +1924,52 @@ DEF_SCRIPT(script_23, "Fault injection - empty NEW_TOKEN")
OP_EXPECT_CONN_CLOSE_INFO(C, OSSL_QUIC_ERR_FRAME_ENCODING_ERROR, 0, 0);
}
-DEF_SCRIPT(script_24, "place holder for multistrem script_24")
+/* 24. Fault injection - excess value of MAX_STREAMS_BIDI */
+static int script_24_inject_plain(RADIX_FAULT *fault, QUIC_PKT_HDR *hdr,
+ unsigned char *buf, size_t len)
+{
+ int ok = 0;
+ WPACKET wpkt;
+ unsigned char frame_buf[16];
+ size_t written;
+
+ if (fault->word0 == 0 || hdr->type != QUIC_PKT_TYPE_1RTT)
+ return 1;
+
+ if (!TEST_true(WPACKET_init_static_len(&wpkt, frame_buf, sizeof(frame_buf), 0)))
+ return 0;
+
+ if (!TEST_true(WPACKET_quic_write_vlint(&wpkt, fault->word1))
+ || !TEST_true(WPACKET_quic_write_vlint(&wpkt, (((uint64_t)1) << 60) + 1))
+ || !TEST_true(WPACKET_get_total_written(&wpkt, &written))
+ || !radix_fault_prepend_frame(fault, frame_buf, written))
+ goto err;
+
+ ok = 1;
+err:
+ if (ok)
+ WPACKET_finish(&wpkt);
+ else
+ WPACKET_cleanup(&wpkt);
+ return ok;
+}
+
+DEF_SCRIPT(script_24, "Fault injection - excess value of MAX_STREAMS_BIDI")
{
+ OP_SIMPLE_PAIR_CONN();
+ OP_ACCEPT_CONN_WAIT(L, S, 0);
+
+ OP_SET_INJECT_PLAIN(S, script_24_inject_plain);
+
+ OP_WRITE(C, "apple", 5);
+ OP_ACCEPT_STREAM_WAIT(S, Sa, 0);
+ OP_READ_EXPECT(Sa, "apple", 5);
+
+ OP_SET_INJECT_WORD(1, OSSL_QUIC_FRAME_TYPE_MAX_STREAMS_BIDI);
+
+ OP_WRITE(Sa, "orange", 6);
+
+ OP_EXPECT_CONN_CLOSE_INFO(C, OSSL_QUIC_ERR_FRAME_ENCODING_ERROR, 0, 0);
}
DEF_SCRIPT(script_25, "place holder for multistrem script_25")