Simplify version checks in the TLSv1.3 client
authortb <tb@openbsd.org>
Mon, 22 Feb 2021 16:13:31 +0000 (16:13 +0000)
committertb <tb@openbsd.org>
Mon, 22 Feb 2021 16:13:31 +0000 (16:13 +0000)
commit2d0eb2a93d37902db52673925b3fdf0daff29d39
tree167e779d8f4017be101a6201615b0958d385a1cf
parent305a92761f80bc0040aafade534448940c1f2885
Simplify version checks in the TLSv1.3 client

Ensure that the server announced TLSv1.3 (and nothing higher) in the
supported_versions extension.  In that case, the legacy_version must
be TLSv1.2 according to RFC 8446, 4.1.3 and 4.2.1.

This commit also removes some unreachable code which is a remnant of
very early TLSv1.3 code from before the legacy fallback was introduced.
Simplify a few checks and adjust some comments nearby.

ok jsing
lib/libssl/tls13_client.c