From: Hugo Landau Date: Mon, 22 Jan 2024 13:53:30 +0000 (+0000) Subject: QUIC CHANNEL: Defer transport parameter generation X-Git-Tag: openssl-3.3.0-alpha1~154 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69616017a613c7442fa51794d51f167b0de2fc9c;p=thirdparty%2Fopenssl.git QUIC CHANNEL: Defer transport parameter generation Reviewed-by: Neil Horman Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/23360) --- diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index 12be659168f..48584ffd3a9 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -342,14 +342,6 @@ static int ch_init(QUIC_CHANNEL *ch) ossl_ackm_set_tx_max_ack_delay(ch->ackm, ossl_ms2time(ch->tx_max_ack_delay)); ossl_ackm_set_rx_max_ack_delay(ch->ackm, ossl_ms2time(ch->rx_max_ack_delay)); - /* - * Determine the QUIC Transport Parameters and serialize the transport - * parameters block. (For servers, we do this later as we must defer - * generation until we have received the client's transport parameters.) - */ - if (!ch->is_server && !ch_generate_transport_params(ch)) - goto err; - ch_update_idle(ch); ossl_list_ch_insert_tail(&ch->port->channel_list, ch); ch->on_port_list = 1; @@ -2584,6 +2576,15 @@ int ossl_quic_channel_start(QUIC_CHANNEL *ch) ch->qrx, ch->qtx)) return 0; + /* + * Determine the QUIC Transport Parameters and serialize the transport + * parameters block. (For servers, we do this later as we must defer + * generation until we have received the client's transport parameters.) + */ + if (!ch->is_server && !ch->got_local_transport_params + && !ch_generate_transport_params(ch)) + return 0; + /* Change state. */ ch_record_state_transition(ch, QUIC_CHANNEL_STATE_ACTIVE); ch->doing_proactive_ver_neg = 0; /* not currently supported */