From 9bad2b86e892b70ea65e87c409ae90f625d3c12c Mon Sep 17 00:00:00 2001 From: Andrew Dinh Date: Tue, 20 May 2025 09:37:20 -0700 Subject: [PATCH] Reset qtls->local_transport_params_consumed to 0 on SSL_clear() Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27656) --- include/internal/quic_tls.h | 2 ++ ssl/quic/quic_tls.c | 7 +++++++ ssl/ssl_lib.c | 2 ++ 3 files changed, 11 insertions(+) diff --git a/include/internal/quic_tls.h b/include/internal/quic_tls.h index eb385bb7ff9..ec0d07da0b3 100644 --- a/include/internal/quic_tls.h +++ b/include/internal/quic_tls.h @@ -96,6 +96,8 @@ int ossl_quic_tls_configure(QUIC_TLS *qtls); /* Advance the state machine */ int ossl_quic_tls_tick(QUIC_TLS *qtls); +void ossl_quic_tls_clear(QUIC_TLS *qtls); + int ossl_quic_tls_set_transport_params(QUIC_TLS *qtls, const unsigned char *transport_params, size_t transport_params_len); diff --git a/ssl/quic/quic_tls.c b/ssl/quic/quic_tls.c index 0cf2adbf5f7..ccc053203d4 100644 --- a/ssl/quic/quic_tls.c +++ b/ssl/quic/quic_tls.c @@ -858,6 +858,13 @@ int ossl_quic_tls_tick(QUIC_TLS *qtls) } #endif +void ossl_quic_tls_clear(QUIC_TLS *qtls) +{ + if (qtls == NULL) + return; + qtls->local_transport_params_consumed = 0; +} + int ossl_quic_tls_set_transport_params(QUIC_TLS *qtls, const unsigned char *transport_params, size_t transport_params_len) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index ab6a1233fb8..18ed42e5040 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -652,6 +652,8 @@ int ossl_ssl_connection_reset(SSL *s) return 0; } + ossl_quic_tls_clear(sc->qtls); + if (!RECORD_LAYER_reset(&sc->rlayer)) return 0; -- 2.47.3