bneradt commented on code in PR #13809: URL: https://github.com/apache/trafficserver/pull/13809#discussion_r4238420411
########## tests/gold_tests/pluginTest/jax_fingerprint/jax_fingerprint_raw_extensions.test.py: ########## @@ -0,0 +1,65 @@ +''' +Verify that jax_fingerprint JA4 counts every ClientHello extension on the wire. + +OpenSSL's ClientHello API omits GREASE and extension types it does not +recognize, such as ALPS. JA4 must still count and hash them. +''' +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +sys.path.insert(0, Test.TestDirectory) +from chrome_client_hello import expected_ja4 + +Test.Summary = __doc__ +Test.SkipUnless(Condition.PluginExists('jax_fingerprint.so')) + +# Wireshark's JA4 for this Chrome ClientHello: 15 non-GREASE ciphers and 16 +# non-GREASE extensions, including ALPS. +CHROME_JA4 = 't13d1516h2_8daaf6152771_e5627efa2ab1' +assert expected_ja4() == CHROME_JA4, expected_ja4() + +ts = Test.MakeATSProcess('ts', enable_tls=True) +ts.addDefaultSSLFiles() +ts.Disk.ssl_multicert_yaml.AddLines( + ''' +ssl_multicert: + - dest_ip: "*" + ssl_cert_name: server.pem + ssl_key_name: server.key +'''.split('\n')) +ts.Disk.records_config.update( + { + 'proxy.config.ssl.server.cert.path': ts.Variables.SSLDir, + 'proxy.config.ssl.server.private_key.path': ts.Variables.SSLDir, + 'proxy.config.diags.debug.enabled': 1, + 'proxy.config.diags.debug.tags': 'jax_fingerprint', + }) +ts.Disk.plugin_config.AddLine('jax_fingerprint.so --method JA4') +ts.Disk.traffic_out.Content += Testers.ContainsExpression( + f'Fingerprint: {CHROME_JA4}', 'JA4 should count GREASE and ALPS as they appear on the wire.') Review Comment: Fixed: the message now says JA4 should count the ALPS extension, which OpenSSL does not recognize. I corrected the test docstring the same way. -- 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]
