summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-10-23 15:38:16 +0100
committerMatt Caswell <matt@openssl.org>2023-10-25 11:14:24 +0100
commit4d100bb76ad43da75660fa8661d258eaa78fb1c3 (patch)
treecd0320767eb14b1237afd468a01be52328c695e2
parent82b7a0eee90e3280bd0e2dd4a9812b3873a7f462 (diff)
QUIC CHANNEL: Correct timeout calculation for ACKs
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)
-rw-r--r--ssl/quic/quic_channel.c30
-rw-r--r--test/recipes/75-test_quicapi_data/ssltraceref-zlib.txt6
-rw-r--r--test/recipes/75-test_quicapi_data/ssltraceref.txt6
3 files changed, 20 insertions, 22 deletions
diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c
index fe2a924433..a956fa4f68 100644
--- a/ssl/quic/quic_channel.c
+++ b/ssl/quic/quic_channel.c
@@ -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));
diff --git a/test/recipes/75-test_quicapi_data/ssltraceref-zlib.txt b/test/recipes/75-test_quicapi_data/ssltraceref-zlib.txt
index 68d3fd86ec..3e41f3cfec 100644
--- a/test/recipes/75-test_quicapi_data/ssltraceref-zlib.txt
+++ b/test/recipes/75-test_quicapi_data/ssltraceref-zlib.txt
@@ -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)
diff --git a/test/recipes/75-test_quicapi_data/ssltraceref.txt b/test/recipes/75-test_quicapi_data/ssltraceref.txt
index 6a6828ec01..2ebfb93b3c 100644
--- a/test/recipes/75-test_quicapi_data/ssltraceref.txt
+++ b/test/recipes/75-test_quicapi_data/ssltraceref.txt
@@ -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)