From: Tomas Mraz Date: Mon, 11 Nov 2024 13:33:57 +0000 (+0100) Subject: txp_generate_stream_frames(): Set stream id in header early enough X-Git-Tag: openssl-3.5.0-alpha1~923 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba6f115ccfbb63fbeb2bc8df3c07918a7a59a186;p=thirdparty%2Fopenssl.git txp_generate_stream_frames(): Set stream id in header early enough Otherwise we will calculate an incorrect header size for higher stream ids and won't fit the frame into the packet. Fixes #25417 Reviewed-by: Saša Nedvědický Reviewed-by: Neil Horman Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/25928) --- diff --git a/ssl/quic/quic_txp.c b/ssl/quic/quic_txp.c index 2532d1edcba..bbbb6a70452 100644 --- a/ssl/quic/quic_txp.c +++ b/ssl/quic/quic_txp.c @@ -2226,6 +2226,7 @@ static int txp_generate_stream_frames(OSSL_QUIC_TX_PACKETISER *txp, rc = 1; goto err; } + chunks[i].shdr.stream_id = id; } for (i = 0;; ++i) { @@ -2339,7 +2340,6 @@ static int txp_generate_stream_frames(OSSL_QUIC_TX_PACKETISER *txp, if (wpkt == NULL) goto err; /* alloc error */ - shdr->stream_id = id; if (!ossl_assert(ossl_quic_wire_encode_frame_stream_hdr(wpkt, shdr))) { /* (Should not be possible.) */ tx_helper_rollback(h);