]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC CHANNEL: Correct timeout calculation for ACKs
authorHugo Landau <hlandau@openssl.org>
Mon, 23 Oct 2023 14:38:16 +0000 (15:38 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 25 Oct 2023 10:14:24 +0000 (11:14 +0100)
ACKs are not restricted by CC so do not consider CC when determining
when we will emit an ACK.

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

ssl/quic/quic_channel.c
test/recipes/75-test_quicapi_data/ssltraceref-zlib.txt
test/recipes/75-test_quicapi_data/ssltraceref.txt

index fe2a924433102a60d0daabf886eed56a2caaba63..a956fa4f686ceb7c44725943e1fe91fa2920d154 100644 (file)
@@ -2608,26 +2608,24 @@ static OSSL_TIME ch_determine_next_tick_deadline(QUIC_CHANNEL *ch)
         deadline = ossl_time_infinite();
 
     /*
-     * If the CC will let us send acks, check the ack deadline for all
-     * enc_levels that are actually provisioned
+     * Check the ack deadline for all enc_levels that are actually provisioned.
+     * ACKs aren't restricted by CC.
      */
-    if (ch->cc_method->get_tx_allowance(ch->cc_data) > 0) {
-        for (i = 0; i < QUIC_ENC_LEVEL_NUM; i++) {
-            if (ossl_qtx_is_enc_level_provisioned(ch->qtx, i)) {
-                deadline = ossl_time_min(deadline,
-                                         ossl_ackm_get_ack_deadline(ch->ackm,
-                                                                    ossl_quic_enc_level_to_pn_space(i)));
-            }
+    for (i = 0; i < QUIC_ENC_LEVEL_NUM; i++) {
+        if (ossl_qtx_is_enc_level_provisioned(ch->qtx, i)) {
+            deadline = ossl_time_min(deadline,
+                                     ossl_ackm_get_ack_deadline(ch->ackm,
+                                                                ossl_quic_enc_level_to_pn_space(i)));
         }
-
-        /*
-         * When do we need to send an ACK-eliciting packet to reset the idle
-         * deadline timer for the peer?
-         */
-        if (!ossl_time_is_infinite(ch->ping_deadline))
-            deadline = ossl_time_min(deadline, ch->ping_deadline);
     }
 
+    /*
+     * When do we need to send an ACK-eliciting packet to reset the idle
+     * deadline timer for the peer?
+     */
+    if (!ossl_time_is_infinite(ch->ping_deadline))
+        deadline = ossl_time_min(deadline, ch->ping_deadline);
+
     /* Apply TXP wakeup deadline. */
     deadline = ossl_time_min(deadline,
                              ossl_quic_tx_packetiser_get_deadline(ch->txp));
index 68d3fd86ecf4c49bf3a4791dcd195242cd16a918..3e41f3cfec476709d98772c3bbcd6574a2d89c8b 100644 (file)
@@ -139,9 +139,6 @@ Received Packet
 Received Frame: Crypto
     Offset: 0
     Len: 1022
-Received Frame: Crypto
-    Offset: 1022
-    Len: 192
 Received TLS Record
 Header:
   Version = TLS 1.2 (0x303)
@@ -247,6 +244,9 @@ YeeuLO02zToHhnQ6KbPXOrQAqcL1kngO4g+j/ru+4AZThFkdkGnltvk=
 ------------------
         No extensions
 
+Received Frame: Crypto
+    Offset: 1022
+    Len: 192
 Received TLS Record
 Header:
   Version = TLS 1.2 (0x303)
index 6a6828ec01eba3c43f6d56ef0fe0b0ddfc5582a5..2ebfb93b3cf88d676956340dc78989709145d4d9 100644 (file)
@@ -137,9 +137,6 @@ Received Packet
 Received Frame: Crypto
     Offset: 0
     Len: 1022
-Received Frame: Crypto
-    Offset: 1022
-    Len: 192
 Received TLS Record
 Header:
   Version = TLS 1.2 (0x303)
@@ -245,6 +242,9 @@ YeeuLO02zToHhnQ6KbPXOrQAqcL1kngO4g+j/ru+4AZThFkdkGnltvk=
 ------------------
         No extensions
 
+Received Frame: Crypto
+    Offset: 1022
+    Len: 192
 Received TLS Record
 Header:
   Version = TLS 1.2 (0x303)