maskit commented on code in PR #13974:
URL: https://github.com/apache/trafficserver/pull/13974#discussion_r4528380620
##########
src/iocore/net/SSLUtils.cc:
##########
@@ -544,6 +544,12 @@ ssl_client_hello_callback(const SSL_CLIENT_HELLO
*client_hello)
// Renegotiation carries a new ClientHello, whose SNI actions must still
run.
TLSBasicSupport *tbs = TLSBasicSupport::getInstance(s);
if (tbs == nullptr || !tbs->is_tls_handshake_complete()) {
+#if HAVE_SSL_CTX_SET_CLIENT_HELLO_CB
+ // The pass that paused returned before binding, so this connection has
not been bound yet.
Review Comment:
nit: this comment is only true for one of the two passes that reach this
return.
1. OpenSSL calls the ClientHello callback once per ClientHello. There's no
HelloRetryRequest guard in `tls_early_post_process_client_hello()`
(`ssl/statem/statem_srvr.c`).
2. After an HRR, the second ClientHello finds the hooks finished and takes
this early return.
3. The first ClientHello already ran the whole callback, including the bind
at the bottom. So this connection *has* been bound.
Binding again here is fine. It recomputes from the same state, and if a
`TS_EVENT_SSL_CERT` hook changed the verify settings in between, the worst case
is a full handshake instead of a resumption.
Suggestion: reword so it doesn't claim the connection is unbound, e.g.
// A pass that paused returned before binding; after a HelloRetryRequest
this binds again, which is harmless.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]