From e9473c7833874cbc1dbfa800b4310b439e1aaac4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 23 Nov 2020 15:37:11 +0100 Subject: [PATCH] MINOR: ssl: QUIC transport parameters parsing. This patch modifies the TLS ClientHello message callback so that to parse the QUIC client transport parameters. --- src/ssl_sock.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/ssl_sock.c b/src/ssl_sock.c index abcca654c6..35298d5305 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -2326,6 +2326,24 @@ int ssl_sock_switchctx_cbk(SSL *ssl, int *al, void *arg) conn = SSL_get_ex_data(ssl, ssl_app_data_index); s = __objt_listener(conn->target)->bind_conf; +#ifdef USE_QUIC + if (conn->qc) { + /* Look for the QUIC transport parameters. */ +#ifdef OPENSSL_IS_BORINGSSL + if (!SSL_early_callback_ctx_extension_get(ctx, TLS_EXTENSION_QUIC_TRANSPORT_PARAMETERS, + &extension_data, &extension_len)) +#else + if (!SSL_client_hello_get0_ext(ssl, TLS_EXTENSION_QUIC_TRANSPORT_PARAMETERS, + &extension_data, &extension_len)) +#endif + goto abort; + + if (!quic_transport_params_store(conn->qc, 0, extension_data, + extension_data + extension_len)) + goto abort; + } +#endif + if (s->ssl_conf.early_data) allow_early = 1; #ifdef OPENSSL_IS_BORINGSSL -- 2.47.3