Commit 6e2ec695c6 for openssl.org
commit 6e2ec695c6a32fef073064a6ae28d23a57eb4a3a
Author: Andrew Dinh <andrewd@openssl.org>
Date: Sat Sep 5 09:40:38 2026 -0400
Port script_61
Assisted-by: Claude:claude-sonnet-5
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
Merge-date: Tue Sep 15 09:39:46 2026
Merged-from: https://github.com/openssl/openssl/pull/32734
diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c
index 51b1e98126..72a5c32414 100644
--- a/test/quic_multistream_test.c
+++ b/test/quic_multistream_test.c
@@ -2577,22 +2577,7 @@ err:
}
static const struct script_op script_61[] = {
- OP_S_SET_INJECT_PLAIN(script_61_inject_plain),
- OP_C_SET_ALPN("ossltest"),
- OP_C_CONNECT_WAIT(),
- OP_C_SET_DEFAULT_STREAM_MODE(SSL_DEFAULT_STREAM_MODE_NONE),
-
- OP_C_NEW_STREAM_BIDI(a, C_BIDI_ID(0)),
- OP_C_WRITE(a, "orange", 6),
-
- OP_S_BIND_STREAM_ID(a, C_BIDI_ID(0)),
- OP_S_READ_EXPECT(a, "orange", 6),
-
- OP_SET_INJECT_WORD(OSSL_QUIC_FRAME_TYPE_RESET_STREAM, S_BIDI_ID(OSSL_QUIC_VLINT_MAX / 4)),
- OP_S_WRITE(a, "fruit", 5),
-
- OP_C_EXPECT_CONN_CLOSE_INFO(OSSL_QUIC_ERR_STREAM_LIMIT_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 322f75fc4c..c5352bf21e 100644
--- a/test/radix/quic_tests.c
+++ b/test/radix/quic_tests.c
@@ -3583,8 +3583,62 @@ DEF_SCRIPT(script_60, "Connection close reason truncation")
OP_FUNC(check_shutdown_reason_60);
}
-DEF_SCRIPT(script_61, "place holder for multistrem script_61")
+/* 61. Fault injection - RESET_STREAM exceeding stream count FC */
+static int script_61_inject_plain(RADIX_FAULT *fault, QUIC_PKT_HDR *hdr,
+ unsigned char *buf, size_t len)
+{
+ int ok = 0;
+ WPACKET wpkt;
+ unsigned char frame_buf[32];
+ 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->word0))
+ || !TEST_true(WPACKET_quic_write_vlint(&wpkt, /* stream ID */
+ fault->word1))
+ || !TEST_true(WPACKET_quic_write_vlint(&wpkt, 123))
+ || (fault->word0 == OSSL_QUIC_FRAME_TYPE_RESET_STREAM
+ && !TEST_true(WPACKET_quic_write_vlint(&wpkt, 0)))) /* final size */
+ goto err;
+
+ if (!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_61, "Fault injection - RESET_STREAM exceeding stream count FC")
{
+ OP_SIMPLE_PAIR_CONN_ND();
+ OP_ACCEPT_CONN_WAIT_ND(L, S, 0);
+
+ OP_SET_INJECT_PLAIN(S, script_61_inject_plain);
+
+ OP_NEW_STREAM(C, Ca, 0 /* bidirectional */);
+ OP_WRITE(Ca, "orange", 6);
+
+ OP_ACCEPT_STREAM_WAIT(S, Sa, 0);
+ OP_READ_EXPECT(Sa, "orange", 6);
+
+ OP_ENGINE_TICK_DISABLE(S);
+ OP_SET_INJECT_WORD(OSSL_QUIC_FRAME_TYPE_RESET_STREAM, S_BIDI_ID(OSSL_QUIC_VLINT_MAX / 4));
+ OP_WRITE(Sa, "fruit", 5);
+ OP_ENGINE_TICK_ENABLE(S);
+
+ OP_EXPECT_CONN_CLOSE_INFO(C, OSSL_QUIC_ERR_STREAM_LIMIT_ERROR, 0, 0);
}
DEF_SCRIPT(script_62, "place holder for multistrem script_62")