Commit cd3c8631ea for openssl.org

commit cd3c8631eae2660b81caa33409dc95d7fca17f6c
Author: Andrew Dinh <andrewd@openssl.org>
Date:   Sat Sep 5 09:42:06 2026 -0400

    Port script_62

    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:47 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 72a5c32414..4513c612f9 100644
--- a/test/quic_multistream_test.c
+++ b/test/quic_multistream_test.c
@@ -2538,44 +2538,6 @@ static const struct script_op script_60[] = {
 };

 /* 61. Fault injection - RESET_STREAM exceeding stream count FC */
-static int script_61_inject_plain(struct helper *h, QUIC_PKT_HDR *hdr,
-    unsigned char *buf, size_t len)
-{
-    int ok = 0;
-    WPACKET wpkt;
-    unsigned char frame_buf[32];
-    size_t written;
-
-    if (h->inject_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, h->inject_word0))
-        || !TEST_true(WPACKET_quic_write_vlint(&wpkt, /* stream ID */
-            h->inject_word1))
-        || !TEST_true(WPACKET_quic_write_vlint(&wpkt, 123))
-        || (h->inject_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)))
-        goto err;
-
-    if (!qtest_fault_prepend_frame(h->qtf, frame_buf, written))
-        goto err;
-
-    ok = 1;
-err:
-    if (ok)
-        WPACKET_finish(&wpkt);
-    else
-        WPACKET_cleanup(&wpkt);
-    return ok;
-}
-
 static const struct script_op script_61[] = {
     /* test moved to test/radix/quic_tests.c */
     OP_END
@@ -2583,22 +2545,7 @@ static const struct script_op script_61[] = {

 /* 62. Fault injection - STOP_SENDING with high ID */
 static const struct script_op script_62[] = {
-    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_STOP_SENDING, C_BIDI_ID(OSSL_QUIC_VLINT_MAX / 4)),
-    OP_S_WRITE(a, "fruit", 5),
-
-    OP_C_EXPECT_CONN_CLOSE_INFO(OSSL_QUIC_ERR_STREAM_STATE_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 c5352bf21e..5edc99ef15 100644
--- a/test/radix/quic_tests.c
+++ b/test/radix/quic_tests.c
@@ -3641,8 +3641,26 @@ DEF_SCRIPT(script_61, "Fault injection - RESET_STREAM exceeding stream count FC"
     OP_EXPECT_CONN_CLOSE_INFO(C, OSSL_QUIC_ERR_STREAM_LIMIT_ERROR, 0, 0);
 }

-DEF_SCRIPT(script_62, "place holder for multistrem script_62")
+/* 62. Fault injection - STOP_SENDING with high ID */
+DEF_SCRIPT(script_62, "Fault injection - STOP_SENDING with high ID")
 {
+    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_STOP_SENDING, C_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_STATE_ERROR, 0, 0);
 }

 DEF_SCRIPT(script_63, "place holder for multistrem script_63")