Commit 7b81755507 for openssl.org

commit 7b81755507c3adc8c60f7c3fdbf10aca7e7125ba
Author: Andrew Dinh <andrewd@openssl.org>
Date:   Mon Aug 3 12:22:35 2026 +0700

    Port script_51

    Assisted-by: Claude:claude-sonnet-5
    Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
    Reviewed-by: Norbert Pocs <norbertp@openssl.org>
    Merge-date: Tue Sep 15 08:51:47 2026
    Merged-from: https://github.com/openssl/openssl/pull/32469

diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c
index 7c18b7cb43..d5bd6e16e5 100644
--- a/test/quic_multistream_test.c
+++ b/test/quic_multistream_test.c
@@ -2505,44 +2505,6 @@ static const struct script_op script_40[] = {
 };

 /* 41. Fault injection - PATH_CHALLENGE yields PATH_RESPONSE */
-static const uint64_t path_challenge = UINT64_C(0xbdeb9451169c83aa);
-
-static int script_41_inject_plain(struct helper *h, QUIC_PKT_HDR *hdr,
-    unsigned char *buf, size_t len)
-{
-    int ok = 0;
-    WPACKET wpkt;
-    unsigned char frame_buf[16];
-    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_word1))
-        || !TEST_true(WPACKET_put_bytes_u64(&wpkt, path_challenge)))
-        goto err;
-
-    if (!TEST_true(WPACKET_get_total_written(&wpkt, &written))
-        || !TEST_size_t_eq(written, 9))
-        goto err;
-
-    if (!qtest_fault_prepend_frame(h->qtf, frame_buf, written))
-        goto err;
-
-    --h->inject_word0;
-    ok = 1;
-err:
-    if (ok)
-        WPACKET_finish(&wpkt);
-    else
-        WPACKET_cleanup(&wpkt);
-    return ok;
-}
-
 static const struct script_op script_41[] = {
     /* test moved to test/radix/quic_tests.c */
     OP_END
@@ -2604,22 +2566,7 @@ static const struct script_op script_50[] = {

 /* 51. Fault injection - PATH_RESPONSE is ignored */
 static const struct script_op script_51[] = {
-    OP_S_SET_INJECT_PLAIN(script_41_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_PATH_RESPONSE),
-
-    OP_S_WRITE(a, "orange", 6),
-    OP_C_READ_EXPECT(DEFAULT, "orange", 6),
-
-    OP_C_WRITE(DEFAULT, "Strawberry", 10),
-    OP_S_READ_EXPECT(a, "Strawberry", 10),
-
+    /* 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 616979b701..290790ad74 100644
--- a/test/radix/quic_tests.c
+++ b/test/radix/quic_tests.c
@@ -2605,7 +2605,7 @@ static const uint64_t script_41_path_challenge = UINT64_C(0xbdeb9451169c83aa);
 static uint64_t script_41_valid_responses;
 static uint64_t script_41_bad_responses;

-static int script_41_inject_plain(RADIX_FAULT *fault, QUIC_PKT_HDR *hdr,
+static int inject_path_challenge_plain(RADIX_FAULT *fault, QUIC_PKT_HDR *hdr,
     unsigned char *buf, size_t len)
 {
     int ok = 0;
@@ -2705,7 +2705,7 @@ DEF_SCRIPT(script_41, "Fault injection - PATH_CHALLENGE yields PATH_RESPONSE")
     OP_WRITE(C, "apple", 5);

     OP_ACCEPT_CONN_WAIT(L, S, 0);
-    OP_SET_INJECT_PLAIN(S, script_41_inject_plain);
+    OP_SET_INJECT_PLAIN(S, inject_path_challenge_plain);
     OP_SELECT_SSL(0, S);
     OP_FUNC(install_trace_41);

@@ -3108,8 +3108,23 @@ DEF_SCRIPT(script_50, "Fault injection - ACK - duplicate PN")
     }
 }

-DEF_SCRIPT(script_51, "place holder for multistrem script_51")
+DEF_SCRIPT(script_51, "Fault injection - PATH_RESPONSE is ignored")
 {
+    OP_SIMPLE_PAIR_CONN();
+    OP_ACCEPT_CONN_WAIT(L, S, 0);
+    OP_SET_INJECT_PLAIN(S, inject_path_challenge_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_PATH_RESPONSE);
+
+    OP_WRITE(Sa, "orange", 6);
+    OP_READ_EXPECT(C, "orange", 6);
+
+    OP_WRITE(C, "Strawberry", 10);
+    OP_READ_EXPECT(Sa, "Strawberry", 10);
 }

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