Skip to content

Commit

Permalink
Don't ask for an invalid group in an HRR
Browse files Browse the repository at this point in the history
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 #21163)

(cherry picked from commit 7a949ae)
  • Loading branch information
mattcaswell committed Jun 23, 2023
1 parent f9b7ca1 commit 98f43f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ssl/statem/extensions.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 98f43f4

Please sign in to comment.