maskit commented on code in PR #12914:
URL: https://github.com/apache/trafficserver/pull/12914#discussion_r2875607530
##########
plugins/experimental/ja4_fingerprint/plugin.cc:
##########
@@ -264,66 +266,64 @@ log_fingerprint(JA4_data const *data)
}
std::uint16_t
-get_version(SSL *ssl)
+get_version(TSClientHello ch)
{
unsigned char const *buf{};
std::size_t buflen{};
- if (SSL_SUCCESS == SSL_client_hello_get0_ext(ssl, EXT_SUPPORTED_VERSIONS,
&buf, &buflen)) {
+ if (TS_SUCCESS == TSClientHelloExtensionGet(ch, EXT_SUPPORTED_VERSIONS,
&buf, &buflen)) {
std::uint16_t max_version{0};
- for (std::size_t i{1}; i < buflen; i += 2) {
- std::uint16_t version{make_word(buf[i - 1], buf[i])};
- if ((!JA4::is_GREASE(version)) && version > max_version) {
+ size_t n_versions = buf[0];
+ for (size_t i = 1; i + 1 < buflen && i < (n_versions * 2) + 1; i += 2) {
+ std::uint16_t version = (buf[i] << 8) | buf[i + 1];
+ if (!JA4::is_GREASE(version) && version > max_version) {
Review Comment:
Not a part of this change
--
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]