Skip to content

fix(ja4t): align Rust JA4T output with Wireshark/Zeek - #310

Merged
vlvkobal merged 2 commits into
FoxIO-LLC:mainfrom
elpy1:ja4t-align-with-wireshark-zeek
Aug 27, 2026
Merged

fix(ja4t): align Rust JA4T output with Wireshark/Zeek#310
vlvkobal merged 2 commits into
FoxIO-LLC:mainfrom
elpy1:ja4t-align-with-wireshark-zeek

Conversation

@elpy1

@elpy1 elpy1 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR aligns Rust with Wireshark/Zeek on:

  • Empty TCP options: emit "00" placeholder instead of an empty field
  • Absent MSS / window scale: zero-pad defaults to "00" instead of "0"
    (window scale stays unpadded when nonzero, matching Wireshark)
  • Duplicated MSS / window-scale options: last occurrence wins
    instead of first

Still unresolved:

  • ECN-flagged SYN behavior (accepted by the Rust implementation
    but ignored by Wireshark/Zeek).

Partially addresses #304

@vlvkobal vlvkobal linked an issue Jul 28, 2026 that may be closed by this pull request
@vlvkobal

vlvkobal commented Aug 6, 2026

Copy link
Copy Markdown
Member

JA4T numeric fields are formatted as decimal values, while 00 is reserved for fields that are absent. The current implementation conflates a missing value with a present value of zero. Could you update the formatting logic and tests to preserve this distinction?

@john-althouse, since this behavior is not currently documented publicly, should we add it somewhere?

@vlvkobal
vlvkobal self-requested a review August 6, 2026 14:48
elpy1 and others added 2 commits August 27, 2026 16:32
Keep the contributor's Wireshark/Zeek-compatible formatter and add a regression test showing that a present single-digit MSS uses a minimum width of two decimal digits.
@vlvkobal

Copy link
Copy Markdown
Member

I rechecked this against the Wireshark and Zeek implementations. Both treat a missing value and an actual zero the same here, so your current implementation is consistent with them. Please ignore my previous comment.

@john-althouse, it might be worth clarifying this in the spec.

@vlvkobal
vlvkobal force-pushed the ja4t-align-with-wireshark-zeek branch from 08c6221 to de9b181 Compare August 27, 2026 16:35
@vlvkobal

Copy link
Copy Markdown
Member

Thanks for the PR, and sorry for the confusion around the 00 behavior.

I rebased the branch and added a small test for it. Everything looks good now - I’m going to merge this.

@vlvkobal
vlvkobal merged commit 02e78ba into FoxIO-LLC:main Aug 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JA4T: no text specification, and Rust diverges from Wireshark/Zeek

2 participants