]> git.ipfire.org Git - thirdparty/suricata.git/commit
smb: protocol detection on pattern without midstream 7282/head
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 22 Nov 2021 10:30:08 +0000 (11:30 +0100)
committerVictor Julien <vjulien@oisf.net>
Thu, 21 Apr 2022 05:21:51 +0000 (07:21 +0200)
commit464ff80c6a8efd1212b617a80c726173573caf42
treebc4e3b978ac5fea13ae0347c18ef476404a78771
parentdc574604275f6fe90266bbfc5cb2430b86f9cc09
smb: protocol detection on pattern without midstream

To recognize a protocol, Suricata first looks for
patterns, which can be confirmed by a probing parser.
If this does not work, Suricata can try to run
some probing parsers on some ports.

This is the case for SMB.

This commit makes handling the confirming and the probing
paser differently even if they share much code.

The confirmation parser knows that a pattern has been found.
So, it must not do the midstream case of looking for this
pattern in the whole buffer, but only check it at the beginning.
But it must reverse direction if needed.
rust/src/smb/smb.rs