From 5a711551a2eb12321630f10f9392d17e975be42f Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Wed, 17 Jan 2024 18:14:44 +0100 Subject: [PATCH] MINOR: quic-be: Version Information transport parameter check Add a little check to verify that the version chosen by the server matches with the client one. Initiliazes local transport parameters ->negotiated_version value with this version if this is the case. If not, return 0; --- src/quic_tp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/quic_tp.c b/src/quic_tp.c index 2e5e47d61..caf66577e 100644 --- a/src/quic_tp.c +++ b/src/quic_tp.c @@ -213,9 +213,18 @@ static int quic_transport_param_dec_version_info(struct tp_version_information * return 0; } - if (server) - /* TODO: not supported */ + if (server) { + int i; + + for (i = 0; i < quic_versions_nb; i++) { + if (tp->chosen == quic_versions[i].num) { + tp->negotiated_version = &quic_versions[i]; + goto out; + } + } + return 0; + } for (ver = others; ver < end; ver += 4) { if (!tp->negotiated_version) {