]> git.ipfire.org Git - thirdparty/suricata.git/commit
smb: fix smb2 header flag parsing
authorJason Ish <jason.ish@oisf.net>
Thu, 17 Feb 2022 22:52:44 +0000 (16:52 -0600)
committerVictor Julien <vjulien@oisf.net>
Fri, 4 Mar 2022 15:50:54 +0000 (16:50 +0100)
commit7b659489c85eaed4921ed9c4b97ecf827560376e
tree7bd44e324d5b2ad03d59b79bbfd37fca994cfa16
parentc3a220647b31b453b0fc14ecfb028defad2778dc
smb: fix smb2 header flag parsing

The bits were being parsed in the order they're displayed in Wireshark,
rather than the order they were being seen on the wire, resulting in
direction and async being 0 more often than they should be.

Instead of bits, take the 4 bytes as an le_u32 and just use bit masks to
extract what we need into a struct, I think its easier to reason about
this way when comparing to the Microsoft documentation.
rust/src/smb/smb2_records.rs