-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update handling of ja4 alpn edge cases #4755
Conversation
stuffer/s2n_stuffer.h
Outdated
*/ | ||
S2N_RESULT s2n_hex_digit(uint8_t nibble, uint8_t *hex_digit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding "stuffer" to the name to match the module makes this confusing, because it doesn't actually take a stuffer. But I'm not sure where else this function should live :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with not adding the prefix. Perhaps renaming it to something like nibble_to_hex
might clarify its purpose?
stuffer/s2n_stuffer.h
Outdated
*/ | ||
S2N_RESULT s2n_hex_digit(uint8_t nibble, uint8_t *hex_digit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with not adding the prefix. Perhaps renaming it to something like nibble_to_hex
might clarify its purpose?
Resolved issues:
Related to FoxIO-LLC/ja4#148
Description of changes:
Update s2n-tls's handling of alpn edge cases to reflect the updates to the spec:
Two of the changes (handling of 1-byte alpns and handling of only one of the first or last characters not being alphanumeric) aren't official yet, but I'm implementing the current consensus answer / matching what wireshark does.
Call-outs:
I'll need to update the compliance comments once the spec is finalized. But this change doesn't technically lower our duvet coverage even in the meantime, because the spec didn't cover any of these cases :)
Testing:
Unit tests, and I was able to uncomment the JA4 pcap that didn't work before.
I also added our own pcap with a wide range of questionable alpn values. I had to add exceptions for a few of those alpn values, because wireshark will need to be updated to not allow values like "__". The cases that pcap covers:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.