]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't ask for an invalid group in an HRR
authorMatt Caswell <matt@openssl.org>
Fri, 9 Jun 2023 08:09:06 +0000 (09:09 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 23 Jun 2023 13:27:17 +0000 (14:27 +0100)
If the client sends us a group in a key_share that is in our
supported_groups list but is otherwise not suitable (e.g. not compatible
with TLSv1.3) we reject it. We should not ask for that same group again
in a subsequent HRR.

Fixes #21157

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/21163)

(cherry picked from commit 7a949ae5f1799a6629cf6deb44ae0f38455a73dd)

ssl/statem/extensions.c

index 977e6a2011abeaee0cf1281a33ce9f92b3fdfaee..0319f3fad8cb5432a0b0e8a65a1e088dc919a257 100644 (file)
@@ -1391,7 +1391,11 @@ static int final_key_share(SSL *s, unsigned int context, int sent)
                     group_id = pgroups[i];
 
                     if (check_in_list(s, group_id, clntgroups, clnt_num_groups,
-                                      1))
+                                      1)
+                            && tls_group_allowed(s, group_id,
+                                                 SSL_SECOP_CURVE_SUPPORTED)
+                            && tls_valid_group(s, group_id, TLS1_3_VERSION,
+                                               TLS1_3_VERSION, 0, NULL))
                         break;
                 }