]> git.ipfire.org Git - thirdparty/suricata.git/commit
smb: fix smb2 header flag parsing
authorJason Ish <jason.ish@oisf.net>
Mon, 18 Apr 2022 16:32:25 +0000 (10:32 -0600)
committerVictor Julien <vjulien@oisf.net>
Tue, 19 Apr 2022 18:53:40 +0000 (20:53 +0200)
commit04f1d9e5a8928f1eed85014b63ecc5bf9307370f
treea57a63255123617896626f8ad45d816cd0fcdaa4
parent08b2ffa4344fed7be245dc32d596702a414ff15f
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.

(cherry picked from commit 7b659489c85eaed4921ed9c4b97ecf827560376e)
rust/src/smb/smb2_records.rs