From: Andrew Dinh Date: Tue, 20 May 2025 16:37:20 +0000 (-0700) Subject: Reset qtls->local_transport_params_consumed to 0 on SSL_clear() X-Git-Tag: openssl-3.5.1~59 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=61ff9d94b37f2707f4a9cb971da0c834549b8727;p=thirdparty%2Fopenssl.git 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) (cherry picked from commit 9bad2b86e892b70ea65e87c409ae90f625d3c12c) --- 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;