Fix up server processing of key shares.
authorbeck <beck@openbsd.org>
Wed, 27 Mar 2024 22:27:09 +0000 (22:27 +0000)
committerbeck <beck@openbsd.org>
Wed, 27 Mar 2024 22:27:09 +0000 (22:27 +0000)
commitbe89428ce5fb176ef7adb0cb4f297af5f2b0fb91
treec774fca355a3b0fd850993a900111348c10f90b1
parentfc31befaf105b97a112f7671f6f1ed3695619019
Fix up server processing of key shares.

Ensure that the client can not provide a duplicate key share
for any group, or send more key shares than groups they support.

Ensure that the key shares must be provided in the same order
as the client preference order specified in supported_groups.

Ensure we only will choose to use a key share that is for the
most preferred group by the client that we also support,
to avoid the client being downgraded by sending a less preferred
key share. If we do not end up with a key share for the most preferred
mutually supported group, will then do a hello retry request
selecting that group.

Add regress for this to regress/tlsext/tlsexttest.c

ok jsing@
lib/libssl/ssl_tlsext.c
regress/lib/libssl/tlsext/tlsexttest.c