]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't create an ack frame if one isn't wanted for this pn_space
authorMatt Caswell <matt@openssl.org>
Tue, 31 Oct 2023 16:24:44 +0000 (16:24 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 1 Nov 2023 18:07:09 +0000 (19:07 +0100)
The txp->want_ack value has different bit values for different pn_space
values. Make sure we take that into account when we read it.

Fixes #22568

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22579)

ssl/quic/quic_txp.c

index ce59900f147ef5e9737cb2e20a62bc1b5fcf8e8c..2af385af0f39093079621df04406b886a12e63e0 100644 (file)
@@ -1786,7 +1786,7 @@ static int txp_generate_pre_token(OSSL_QUIC_TX_PACKETISER *txp,
     /* ACK Frames (Regenerate) */
     if (a->allow_ack
         && tx_helper_get_space_left(h) >= MIN_FRAME_SIZE_ACK
-        && (txp->want_ack
+        && (((txp->want_ack & (1UL << pn_space)) != 0)
             || ossl_ackm_is_ack_desired(txp->args.ackm, pn_space))
         && (ack = ossl_ackm_get_ack_frame(txp->args.ackm, pn_space)) != NULL) {
         WPACKET *wpkt = tx_helper_begin(h);