Copilot commented on code in PR #13719:
URL: https://github.com/apache/trafficserver/pull/13719#discussion_r4076836308


##########
plugins/experimental/ja4_fingerprint/test_ja4.cc:
##########
@@ -251,6 +250,28 @@ TEST_CASE("JA4")
     CHECK("ip" == call_JA4(TLS_summary).substr(8, 2));
   }
 
+  SECTION("Given the first or the last byte of the ALPN value is not ASCII 
alphanumeric, "
+          "when we create a JA4 fingerprint, "
+          "then indices [8,9] thereof should contain the hex representation of 
those bytes.")
+  {
+    std::vector<std::pair<std::string, std::string>> values{
+      {std::string{"\xab"},             "ab"},

Review Comment:
   This new one-byte ALPN case exposes a production-path problem in the other 
plugin: `ja4_fingerprint/plugin.cc:get_first_ALPN()` still asserts `buflen > 
4`, but a valid one-byte protocol name has a 4-byte ALPN payload, so debug 
builds abort before this hex encoding runs. Relax that boundary check and 
validate the length before slicing so the supported single-byte case works in 
the plugin as well.



-- 
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]

Reply via email to