Rework the exit path of tls13_handshake_recv_action()
authortb <tb@openbsd.org>
Sat, 3 Feb 2024 19:57:14 +0000 (19:57 +0000)
committertb <tb@openbsd.org>
Sat, 3 Feb 2024 19:57:14 +0000 (19:57 +0000)
commit69e80cb6317d62961165906a2d52608dfd07beae
treeacbeb4b3430d4d357eb83ce62e2e71101b7043cc
parent81fb472f136e03be4db5acdf90d9ac9fd7ec035c
Rework the exit path of tls13_handshake_recv_action()

If an error occurs in action->recv() for a handshake that needs to
downgrade to legacy TLS, the artistic exit path led to hiding the
error under TLS13_IO_USE_LEGACY. Rework the exit path to be easier
to follow, preserving behavior except that the error can no longer
be masked.

Detailed analysis and initial diff by Masaru Masuda.
Fixes https://github.com/libressl/openbsd/issues/146

ok beck
lib/libssl/tls13_handshake.c