From 92491e63683e77e3c90ab323a2eeeea6cdde70b7 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Tue, 4 Feb 2025 10:16:27 +1000 Subject: [PATCH] TLS 1.3 HRR KeyShare: Improve comments HelloRetryRequest has the key exchange group it wants to use. A KeyShare for that group must not have been in the ClientHello. --- src/tls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tls.c b/src/tls.c index b74b8be8e..4df548fec 100644 --- a/src/tls.c +++ b/src/tls.c @@ -9270,13 +9270,15 @@ int TLSX_KeyShare_Parse(WOLFSSL* ssl, const byte* input, word16 length, if (ssl->error != WC_NO_ERR_TRACE(WC_PENDING_E)) #endif { - /* Check the selected group was supported by ClientHello extensions. */ + /* Check the selected group was supported by ClientHello extensions. + */ if (!TLSX_SupportedGroups_Find(ssl, group, ssl->extensions)) { WOLFSSL_ERROR_VERBOSE(BAD_KEY_SHARE_DATA); return BAD_KEY_SHARE_DATA; } - /* Check if the group was sent. */ + /* Make sure KeyShare for server requested group was not sent in + * ClientHello. */ if (TLSX_KeyShare_Find(ssl, group)) { WOLFSSL_ERROR_VERBOSE(BAD_KEY_SHARE_DATA); return BAD_KEY_SHARE_DATA;