]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Use the recorded short conn id len in pktsplitbio
authorNeil Horman <nhorman@openssl.org>
Wed, 29 Jan 2025 18:19:49 +0000 (13:19 -0500)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:34 +0000 (11:27 -0500)
Do the same thing in our pktsplit bio

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26592)

test/helpers/pktsplitbio.c

index 8b8ff364abe5166f84c3f6e6eeb7e64fe73bd627..3e5a31de77e4c1446fb1dfb6652bd390ac210c01 100644 (file)
@@ -53,8 +53,9 @@ static int pkt_split_dgram_recvmmsg(BIO *bio, BIO_MSG *msg, size_t stride,
     BIO *next = BIO_next(bio);
     size_t i, j, data_len = 0, msg_cnt = 0;
     BIO_MSG *thismsg;
+    QTEST_DATA *bdata = BIO_get_data(bio);
 
-    if (!TEST_ptr(next))
+    if (!TEST_ptr(next) || !TEST_ptr(bdata))
         return 0;
 
     /*
@@ -88,11 +89,8 @@ static int pkt_split_dgram_recvmmsg(BIO *bio, BIO_MSG *msg, size_t stride,
             return 0;
 
         /* Decode the packet header */
-        /*
-         * TODO(QUIC SERVER): We need to query the short connection id len
-         * here, e.g. via some API SSL_get_short_conn_id_len()
-         */
-        if (ossl_quic_wire_decode_pkt_hdr(&pkt, 0, 0, 0, &hdr, NULL, NULL) != 1)
+        if (ossl_quic_wire_decode_pkt_hdr(&pkt, bdata->short_conn_id_len,
+                                          0, 0, &hdr, NULL, NULL) != 1)
             return 0;
         remain = PACKET_remaining(&pkt);
         if (remain > 0) {