summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-02-21 10:18:59 +0000
committerHugo Landau <hlandau@openssl.org>2023-03-30 11:14:09 +0100
commit4648eac53385c5e04bd4ec9dcefe04a74d4221c3 (patch)
tree4515089511b1cac9e3cd13f1f069c25911a72e9f
parentb212d554e70930d8ebe425e535b0c3621b961541 (diff)
QUIC CHANNEL: Fix idle timeout handling
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20348)
-rw-r--r--ssl/quic/quic_channel.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c
index 2774329e5c..8ffb5b99e4 100644
--- a/ssl/quic/quic_channel.c
+++ b/ssl/quic/quic_channel.c
@@ -255,6 +255,13 @@ static int ch_init(QUIC_CHANNEL *ch)
if ((ch->qtls = ossl_quic_tls_new(&tls_args)) == NULL)
goto err;
+ ch->rx_max_ack_delay = QUIC_DEFAULT_MAX_ACK_DELAY;
+ ch->rx_ack_delay_exp = QUIC_DEFAULT_ACK_DELAY_EXP;
+ ch->rx_active_conn_id_limit = QUIC_MIN_ACTIVE_CONN_ID_LIMIT;
+ ch->max_idle_timeout = QUIC_DEFAULT_IDLE_TIMEOUT;
+ ch->tx_enc_level = QUIC_ENC_LEVEL_INITIAL;
+ ch->rx_enc_level = QUIC_ENC_LEVEL_INITIAL;
+
/*
* Determine the QUIC Transport Parameters and serialize the transport
* parameters block. (For servers, we do this later as we must defer
@@ -263,12 +270,6 @@ static int ch_init(QUIC_CHANNEL *ch)
if (!ch->is_server && !ch_generate_transport_params(ch))
goto err;
- ch->rx_max_ack_delay = QUIC_DEFAULT_MAX_ACK_DELAY;
- ch->rx_ack_delay_exp = QUIC_DEFAULT_ACK_DELAY_EXP;
- ch->rx_active_conn_id_limit = QUIC_MIN_ACTIVE_CONN_ID_LIMIT;
- ch->max_idle_timeout = QUIC_DEFAULT_IDLE_TIMEOUT;
- ch->tx_enc_level = QUIC_ENC_LEVEL_INITIAL;
- ch->rx_enc_level = QUIC_ENC_LEVEL_INITIAL;
ch_update_idle(ch);
ossl_quic_reactor_init(&ch->rtor, ch_tick, ch,
ch_determine_next_tick_deadline(ch));
@@ -971,7 +972,7 @@ static int ch_on_transport_params(const unsigned char *params,
goto malformed;
}
- if (v < ch->max_idle_timeout)
+ if (v > 0 && v < ch->max_idle_timeout)
ch->max_idle_timeout = v;
ch_update_idle(ch);