]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: ssl: Fix 0rtt to the server
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 8 Aug 2025 16:26:29 +0000 (18:26 +0200)
committerOlivier Houchard <cognet@ci0.org>
Fri, 8 Aug 2025 17:13:37 +0000 (19:13 +0200)
commit13aa5616c9f99dbca0711fd18f716bd6f48eb2ae
tree439eddadac4c1fd07a0ebfe493a91747d529dc25
parentc10e8401e2543e5a008a6c5da3c4d4dc7369f3f5
BUG/MEDIUM: ssl: Fix 0rtt to the server

In order to send early data, we have to make sure no handshake has been
initiated at all. To do that, we remove the CO_FL_SSL_WAIT_HS flag, so
that we won't attempt to start a handshake. However, by removing those
flags, we allow ssl_sock_to_buf() to call SSL_read(), as it's no longer
aware that no handshake has been done, and SSL_read() will begin the
handshake, thus preventing us from sending early data.
The fix is to just call SSL_in_before() to check if no handshake has
been done yet, in addition to checking CO_FL_SSL_WAIT_HS (both are
needed, as CO_FL_SSL_WAIT_HS may come back in case of renegociation).
In ssl_sock_from_buf(), fix the check to see if we may attempt to send
early data. Use SSL_in_before() instead of SSL_is_init_finished(), as
SSL_is_init_finished() will return 1 if the handshake has been started,
but not terminated, and if the handshake has been started, we can no
longer send early data.
This fixes errors when attempting to send early data (as well as
actually sending early data).

This should be backported up to 2.8.
src/ssl_sock.c