]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC TXP: Fix bug relating to STREAM FIN generation
authorHugo Landau <hlandau@openssl.org>
Tue, 18 Jul 2023 15:15:15 +0000 (16:15 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 31 Jul 2023 13:03:25 +0000 (14:03 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21484)

ssl/quic/quic_txp.c

index 1f3715e170740cc8e956a7da4e93b4bbbd20f574..55755eddf8f738bb462b269088cb135931b33437 100644 (file)
@@ -2141,6 +2141,13 @@ static int txp_generate_stream_frames(OSSL_QUIC_TX_PACKETISER *txp,
         if (shdr->is_fin)
             chunks[(i + 1) % 2].valid = 0;
 
+        /*
+         * We are now committed to our length (shdr->len can't change).
+         * If we truncated the chunk, clear the FIN bit.
+         */
+        if (shdr->len < orig_len)
+            shdr->is_fin = 0;
+
         /* Truncate IOVs to match our chosen length. */
         ossl_quic_sstream_adjust_iov((size_t)shdr->len, chunks[i % 2].iov,
                                      chunks[i % 2].num_stream_iovec);