bneradt commented on code in PR #13809:
URL: https://github.com/apache/trafficserver/pull/13809#discussion_r4482924014
##########
src/iocore/net/TLSSNISupport.cc:
##########
@@ -138,6 +141,111 @@ TLSSNISupport::on_client_hello(ClientHello &client_hello)
}
}
+void
+TLSSNISupport::on_client_hello_message(const uint8_t *msg, size_t len)
+{
+ _reset_raw_extension_types();
+
+ auto const count =
+ parse_client_hello_extension_types(msg, len,
_fast_raw_extension_storage.data(), _fast_raw_extension_storage.size());
+ if (!count) {
+ Metrics::Counter::increment(ssl_rsb.client_hello_raw_parse_failure);
+ Dbg(dbg_ctl_ssl_sni, "Could not parse the extensions of the raw
ClientHello");
+ return;
+ }
+ if (*count <= _fast_raw_extension_storage.size()) {
+ _raw_extension_types = _fast_raw_extension_storage.data();
+ } else {
+ _slow_raw_extension_storage = std::make_unique<int[]>(*count);
+ parse_client_hello_extension_types(msg, len,
_slow_raw_extension_storage.get(), *count);
Review Comment:
Good catch. Fixed in 3c5ce08fe3: the second parse into the overflow storage
now checks the stored count. If it differs from the first pass, it counts a raw
parse failure and resets the raw list.
--
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]