]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 years agorust: fix vendor use on MinGW 4490/head
Victor Julien [Fri, 17 Jan 2020 15:40:38 +0000 (16:40 +0100)] 
rust: fix vendor use on MinGW

5 years agorust: Don't use --frozen during build.
Jason Ish [Thu, 16 Jan 2020 15:30:28 +0000 (09:30 -0600)] 
rust: Don't use --frozen during build.

If sources are vendored, we get the same effect of using frozen
with a lock file, and the Cargo.lock is generated based
on the vendored sources.

This also removes the need to ship a Cargo.lock.

Fixed out of source builds with vendored sources.

5 years agorust/Makefile: Don't include Cargo.toml
Jason Ish [Thu, 16 Jan 2020 15:09:13 +0000 (09:09 -0600)] 
rust/Makefile: Don't include Cargo.toml

There is no need to include Cargo.toml in the distribution,
it is always generated from Cargo.toml.in during
./configure.

5 years agogithub-ci: do distcheck on fedora 31 build
Jason Ish [Wed, 8 Jan 2020 16:16:40 +0000 (10:16 -0600)] 
github-ci: do distcheck on fedora 31 build

There were no distchecks being done on builds from git.

5 years agogithub-ci: make distcheck on centos 7 build
Jason Ish [Tue, 31 Dec 2019 15:19:43 +0000 (09:19 -0600)] 
github-ci: make distcheck on centos 7 build

Tests distcheck on a build from a distribution archive.

5 years agodoc/conf: Update copyright and regex for version
Shivani Bhardwaj [Sat, 21 Dec 2019 00:22:42 +0000 (05:52 +0530)] 
doc/conf: Update copyright and regex for version

Make the new regex in compliance with the modern autoconf syntax.
Closes redmine ticket #3423

5 years agodoc: minor capitalization fix 4460/head
jason taylor [Wed, 18 Dec 2019 14:59:54 +0000 (09:59 -0500)] 
doc: minor capitalization fix

Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years agodoc: add bsize documentation and rule example
jason taylor [Wed, 18 Dec 2019 14:59:23 +0000 (09:59 -0500)] 
doc: add bsize documentation and rule example

Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years agorust: remove unnecessary parentheses (Rust 1.40 fixup) 4457/head
Jason Ish [Thu, 19 Dec 2019 17:02:56 +0000 (11:02 -0600)] 
rust: remove unnecessary parentheses (Rust 1.40 fixup)

Rust 1.40 in strict mode will now fail the build on the
presence of unnecessary parentheses.

warning: unnecessary parentheses around type
  --> src/smb/smb2_ioctl.rs:41:12
   |
41 |         -> (&mut SMBTransaction)
   |            ^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
   |
   = note: `#[warn(unused_parens)]` on by default

5 years agogithub-ci: use container for 18.04 build 4444/head
Jason Ish [Fri, 13 Dec 2019 15:14:35 +0000 (09:14 -0600)] 
github-ci: use container for 18.04 build

As the action runs natively on 18.04 we were not explicitly
setting a container, but this means we're using what GitHub
provides us as a default state which might be broken. Instead
use the standard Ubuntu 18.04 container.

5 years agoversion: starting work on 5.0.2
Victor Julien [Fri, 13 Dec 2019 15:49:52 +0000 (16:49 +0100)] 
version: starting work on 5.0.2

5 years agoversion: release 5.0.1 suricata-5.0.1
Victor Julien [Thu, 12 Dec 2019 08:54:45 +0000 (09:54 +0100)] 
version: release 5.0.1

5 years agochangelog: update for 5.0.1
Victor Julien [Fri, 13 Dec 2019 10:09:18 +0000 (11:09 +0100)] 
changelog: update for 5.0.1

5 years agodetect/asn1: fix offset bounds checking
Victor Julien [Sun, 3 Nov 2019 08:50:14 +0000 (09:50 +0100)] 
detect/asn1: fix offset bounds checking

5 years agoipv4: continue parsing options after invalid option
Jason Ish [Thu, 14 Nov 2019 20:56:43 +0000 (14:56 -0600)] 
ipv4: continue parsing options after invalid option

As long as an option has a valid length, we can continue
parsing the options after an invalid one.

5 years agoipv4: fail packet decoding on bad ipv4 option length
Jason Ish [Thu, 14 Nov 2019 17:34:56 +0000 (11:34 -0600)] 
ipv4: fail packet decoding on bad ipv4 option length

Currently all failures in IPv4 option decode are ignore with
respect to continuing to handle the packet.

Change this to fail, and abort handling the packet if the
option length is invalid.

Ticket 3328:
https://redmine.openinfosecfoundation.org/issues/3328

5 years agostream: reject broken ACK packets
Victor Julien [Thu, 21 Nov 2019 15:10:21 +0000 (16:10 +0100)] 
stream: reject broken ACK packets

Fix evasion posibility by rejecting packets with a broken ACK field.
These packets have a non-0 ACK field, but do not have a ACK flag set.

Bug #3324.

Reported-by: Nicolas Adba
5 years agostream: fix SYN_SENT RST/FIN injection
Victor Julien [Thu, 21 Nov 2019 13:47:04 +0000 (14:47 +0100)] 
stream: fix SYN_SENT RST/FIN injection

RST injection during the SYN_SENT state could trick Suricata into marking
a session as CLOSED. The way this was done is: using invalid TSECR value
in RST+ACK packet. The ACK was needed to force Linux into considering the
TSECR value and compare it to the TSVAL from the SYN packet.

The second works only against Windows. The client would not use a TSVAL
but the RST packet would. Windows will reject this, but Suricata considered
the RST valid and triggered the CLOSED logic.

This patch addresses both. When the SYN packet used timestamp support
the timestamp of incoming packet is validated. Otherwise, packet responding
should not have a timestamp.

Bug #3286

Reported-by: Nicolas Adba
5 years agoconfigure: require libhtp 0.5.32 4441/head
Victor Julien [Fri, 13 Dec 2019 10:12:15 +0000 (11:12 +0100)] 
configure: require libhtp 0.5.32

5 years agodecode/tcp: accept TCP fast open cookie request
Victor Julien [Thu, 12 Dec 2019 14:57:29 +0000 (15:57 +0100)] 
decode/tcp: accept TCP fast open cookie request

5 years agoconfigure: fix test -f for rust/vendor, should be -e
Jason Ish [Tue, 10 Dec 2019 22:40:35 +0000 (16:40 -0600)] 
configure: fix test -f for rust/vendor, should be -e

Introduced with commit: c08ec8d8b27280e2bcb066c9caa24da97e0419ee

5 years agogithub-ci: in a dist build, check that --frozen is being used
Jason Ish [Tue, 10 Dec 2019 22:22:02 +0000 (16:22 -0600)] 
github-ci: in a dist build, check that --frozen is being used

Verify that ./configure is picking up the vendored Rust sources
when building from a dist archive.

5 years agohtp: close request only from request side
Victor Julien [Wed, 11 Dec 2019 19:57:57 +0000 (20:57 +0100)] 
htp: close request only from request side

This allows the response side to keep going for just
a bit longer.

5 years agostream: in IDS mode, call app-layer at EOF
Victor Julien [Wed, 11 Dec 2019 19:57:07 +0000 (20:57 +0100)] 
stream: in IDS mode, call app-layer at EOF

On stream end call app-layer with empty message in IDS mode.

5 years agoeve: support pcap_filename for unix socket mode 4436/head
Victor Julien [Tue, 10 Dec 2019 11:48:56 +0000 (12:48 +0100)] 
eve: support pcap_filename for unix socket mode

Bug #3390.

5 years agodoc/commandline: -i option is useable several times
Daisu [Wed, 13 Mar 2019 22:39:48 +0000 (23:39 +0100)] 
doc/commandline: -i option is useable several times

5 years agodoc/install: fix geoip typo
Steven Hostetler [Tue, 29 Oct 2019 03:06:00 +0000 (23:06 -0400)] 
doc/install: fix geoip typo

5 years agodoc/eve: layout and formatting fixes
Victor Julien [Tue, 10 Dec 2019 11:26:44 +0000 (12:26 +0100)] 
doc/eve: layout and formatting fixes

5 years agodoc: update http keywords documentation
Jason Williams [Mon, 25 Nov 2019 23:44:57 +0000 (16:44 -0700)] 
doc: update http keywords documentation

5 years agoyaml: clarify comment about dump-all-headers
Philippe Antoine [Wed, 30 Oct 2019 08:12:42 +0000 (09:12 +0100)] 
yaml: clarify comment about dump-all-headers

Logs a warning if the value is unknown
Fixes #2810

5 years agoconfigure: assume cargo vendor if cargo >= 1.37
Jason Ish [Sun, 24 Nov 2019 05:35:56 +0000 (23:35 -0600)] 
configure: assume cargo vendor if cargo >= 1.37

Rust/Cargo 1.37 and greater has vendor support built-in.

5 years agodetect/parse: track negation during address parsing 4434/head
Victor Julien [Mon, 9 Dec 2019 16:09:20 +0000 (17:09 +0100)] 
detect/parse: track negation during address parsing

Fix address negation detection not resolving variables when
looking for the negation.

This patch makes use of the actual parsing routines to relay this
information to the signature parser.

Bug #3389.

Fixes: 92f08d85aac2 ("detect/iponly: improve negation handling in parsing")
5 years agodetect/iponly: debug output improvements
Victor Julien [Mon, 9 Dec 2019 16:08:45 +0000 (17:08 +0100)] 
detect/iponly: debug output improvements

5 years agoapp-layer: optimize inspection id tracking
Victor Julien [Thu, 5 Dec 2019 14:31:28 +0000 (15:31 +0100)] 
app-layer: optimize inspection id tracking

Increase the inspect id for a completely inspected tx in any case.
This avoids re-evaluating transactions.

Reported-by: Ilya Bakhtin
5 years agosmb1: allow empty trans records
Victor Julien [Wed, 4 Dec 2019 09:22:55 +0000 (10:22 +0100)] 
smb1: allow empty trans records

5 years agosmb1: fix 'event' txs not getting closed
Victor Julien [Wed, 4 Dec 2019 09:06:01 +0000 (10:06 +0100)] 
smb1: fix 'event' txs not getting closed

If the only reason we created a request side TX was to set an event,
we would not close it.

This patch always looks up the TX from the response side.

5 years agosmb/dcerpc: close request tx sooner
Victor Julien [Tue, 3 Dec 2019 08:27:34 +0000 (09:27 +0100)] 
smb/dcerpc: close request tx sooner

5 years agosmb: post-GAP handling update
Victor Julien [Tue, 3 Dec 2019 08:25:48 +0000 (09:25 +0100)] 
smb: post-GAP handling update

Close all prior transactions in the direction of the GAP, except the
file xfers. Those use their own logic.

5 years agosmb: winreg is a DCERPC facility
Victor Julien [Mon, 2 Dec 2019 19:57:59 +0000 (20:57 +0100)] 
smb: winreg is a DCERPC facility

5 years agofiles: add call for setting inspect sizes
Victor Julien [Thu, 5 Dec 2019 14:00:40 +0000 (15:00 +0100)] 
files: add call for setting inspect sizes

The inspect sizes are currently only used during file prune
house keeping for SMTP.

5 years agosmtp: fix and clean up new file handling
Victor Julien [Mon, 2 Dec 2019 10:49:18 +0000 (11:49 +0100)] 
smtp: fix and clean up new file handling

Set tx id on files that were just opened.

Move logic to a small util func.

5 years agosmtp: use FILE_USE_DETECT for raw-extract
Victor Julien [Fri, 22 Nov 2019 12:45:10 +0000 (13:45 +0100)] 
smtp: use FILE_USE_DETECT for raw-extract

5 years agofiles: change pruning behavior
Victor Julien [Fri, 22 Nov 2019 16:27:19 +0000 (17:27 +0100)] 
files: change pruning behavior

If file prune is called inspect has already run. So if file is closed
we can just prune. No need to consider a window anymore.

When still in progress, fix the left_edge calculation.

5 years agofiles: fix FILE_USE_DETECT with --disable-detection
Victor Julien [Sun, 24 Nov 2019 08:16:29 +0000 (09:16 +0100)] 
files: fix FILE_USE_DETECT with --disable-detection

Don't set FILE_USE_DETECT flag if detect is disabled.

5 years agofiles: move smtp prune logic to main
Victor Julien [Sun, 24 Nov 2019 08:16:46 +0000 (09:16 +0100)] 
files: move smtp prune logic to main

Now that we call the file prune loop very regularly, we can move the
SMTP specific inspection pruning logic into this loop. Helps with
cases there we don't (often) update a files inspection trackers.

5 years agohttp/file: modernize unittests
Victor Julien [Mon, 25 Nov 2019 14:17:29 +0000 (15:17 +0100)] 
http/file: modernize unittests

Part of ticket #2975.

5 years agofastlog: apply icmp type logic to icmpv6 too 4431/head
Victor Julien [Mon, 9 Dec 2019 10:30:10 +0000 (11:30 +0100)] 
fastlog: apply icmp type logic to icmpv6 too

5 years agohttp/multipart: small cleanup
Victor Julien [Mon, 25 Nov 2019 18:09:10 +0000 (19:09 +0100)] 
http/multipart: small cleanup

5 years agohttp/multipart: use wider type for boundary lengths
Victor Julien [Mon, 25 Nov 2019 16:16:56 +0000 (17:16 +0100)] 
http/multipart: use wider type for boundary lengths

Use uint32_t for a local type instead of uint8_t to avoid casts.

Length should always stay under this regardless.

5 years agohttp/multipart: optimize form end search
Victor Julien [Mon, 25 Nov 2019 16:01:59 +0000 (17:01 +0100)] 
http/multipart: optimize form end search

If we already know that the boundary exists, we can start looking
there. Otherwise, we can skip trying as the boundary is a subset
of the form end marker.

5 years agohttp/multipart: process incomplete file data
Victor Julien [Mon, 25 Nov 2019 14:21:32 +0000 (15:21 +0100)] 
http/multipart: process incomplete file data

Start processing multipart data as soon as it is available to
allow inspection sooner.

5 years agodetect/analyzer: Suppress direction warnings
Jeff Lucovsky [Fri, 6 Dec 2019 00:15:13 +0000 (19:15 -0500)] 
detect/analyzer: Suppress direction warnings

This commit ensures direction warnings for ICMP v4 and v6
are suppressed and corrects check so that both protocols
are checked (instead of the same protocol being checked twice).

5 years agosuricata: fix computing of default packet size
Eric Leblond [Sat, 7 Dec 2019 09:43:28 +0000 (10:43 +0100)] 
suricata: fix computing of default packet size

Update the default packet size computation to use LiveDeviceName
instead of LiveDevice as the LiveDevice list is not built when
the default packet size is built.

5 years agotravis: remove cocci and macos builds 4428/head
Jason Ish [Fri, 6 Dec 2019 21:10:23 +0000 (15:10 -0600)] 
travis: remove cocci and macos builds

These tests are covered by Github actions and removing
them may speed up the Travis builds to get results sooner.

Its still worth keeping some of these builds as they test
more compile time options than the Github Actions currently
do.

5 years agoconfigure.ac: remove AC_CHECK_FILE
Fabrice Fontaine [Sat, 26 Oct 2019 11:30:43 +0000 (13:30 +0200)] 
configure.ac: remove AC_CHECK_FILE

The use of AC_CHECK_FILE and AC_CHECK_FILES cause the following error
when cross-compiling:

  configure: error: cannot check for file existence when cross compiling

The solution is to check for the file directly instead of using a macro.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
5 years agoconfigure: fixing rust/cargo cross compile command
Ciprian [Mon, 2 Dec 2019 12:07:15 +0000 (14:07 +0200)] 
configure: fixing rust/cargo cross compile command

adding --target argument to cargo command line when cross compiling

5 years agodetect/replace: fix debug print issue 4420/head
Victor Julien [Thu, 28 Nov 2019 10:48:19 +0000 (11:48 +0100)] 
detect/replace: fix debug print issue

Don't print field that will likely not be 0 terminated.

5 years agodetect/file.data: fix buffer reusing id 0
Victor Julien [Mon, 2 Dec 2019 13:35:04 +0000 (14:35 +0100)] 
detect/file.data: fix buffer reusing id 0

5 years agohttp/multipart: use proper progress value to test eof
Victor Julien [Mon, 25 Nov 2019 13:03:13 +0000 (14:03 +0100)] 
http/multipart: use proper progress value to test eof

5 years agodocs: update datasets examples
jason taylor [Thu, 17 Oct 2019 01:16:52 +0000 (21:16 -0400)] 
docs: update datasets examples

Signed-off-by: jason taylor <jtfas90@gmail.com>
5 years agofastlog: use icmp type and code instead of port
Philippe Antoine [Wed, 30 Oct 2019 08:46:53 +0000 (09:46 +0100)] 
fastlog: use icmp type and code instead of port

Fixes #3266

5 years agofastlog: move code to reduce variable scope
Philippe Antoine [Wed, 30 Oct 2019 08:33:51 +0000 (09:33 +0100)] 
fastlog: move code to reduce variable scope

5 years agotransform: fixes comment about compress_whitespace
Philippe Antoine [Thu, 7 Nov 2019 16:10:14 +0000 (17:10 +0100)] 
transform: fixes comment about compress_whitespace

5 years agotransform: updates doc about compress_whitespace
Philippe Antoine [Wed, 6 Nov 2019 09:15:21 +0000 (10:15 +0100)] 
transform: updates doc about compress_whitespace

And removes duplicate test from strip_whitespace

5 years agoqa/banned-functions: remove strndup now we have a fall back
Victor Julien [Sun, 24 Nov 2019 19:13:30 +0000 (20:13 +0100)] 
qa/banned-functions: remove strndup now we have a fall back

5 years agoqa/coccinelle: fix make distcheck
Eric Leblond [Sat, 30 Nov 2019 18:07:05 +0000 (19:07 +0100)] 
qa/coccinelle: fix make distcheck

We need to use top_srcdir to know where the sources are. Relative
directory is not enough.

5 years agoqa/coccinelle: flag check for setter and getter
Eric Leblond [Sat, 30 Nov 2019 17:24:06 +0000 (18:24 +0100)] 
qa/coccinelle: flag check for setter and getter

WHen adding something like
/* coccinelle: AppLayerParserStateIssetFlag():4,2:APP_LAYER_PARSER_ */
the coccinelle check will consider that AppLayerParserStateIssetFlag
is taking 4 parameters and that the second one is a flag that needs
to be checked against APP_LAYER_PARSER_.

5 years agoqa/coccinelle: fix false positive in setter getter
Eric Leblond [Sat, 30 Nov 2019 16:20:44 +0000 (17:20 +0100)] 
qa/coccinelle: fix false positive in setter getter

Coccinelle test was doing a false positive on the function
AppLayerParserStateSetFlag and AppLayerParserStateIssetFlag.
To address that, this patch adds a new coccinelle markup:

 /* coccinelle: AppLayerParserStateSetFlag():2,2:APP_LAYER_PARSER_ */

It indicates that AppLayerParserStateSetFlag is a setter and getter
and that the checks should be disabled inside the function.

Currently this markup is only used for that but following patch will
add some checks on option value.

5 years agoqa/coccinelle: port struct-flags.py to Python3
Eric Leblond [Sat, 30 Nov 2019 10:20:06 +0000 (11:20 +0100)] 
qa/coccinelle: port struct-flags.py to Python3

5 years agoqa/coccinelle: reformat struct-flags.py
Eric Leblond [Sat, 30 Nov 2019 10:17:50 +0000 (11:17 +0100)] 
qa/coccinelle: reformat struct-flags.py

5 years agoqa: generate struct-flags.cocci at each run
Eric Leblond [Thu, 21 Nov 2019 17:26:49 +0000 (18:26 +0100)] 
qa: generate struct-flags.cocci at each run

5 years agodoc: fix typo on example
EmilienCourt [Wed, 4 Dec 2019 10:07:26 +0000 (11:07 +0100)] 
doc: fix typo on example

Quotes have been forgotten in the dnp3.data example, which throws an
SC_ERR_INVALID_SIGNATURE(39) if used like in the example.

5 years agodetect/analyzer: Improved fast pattern display
Jeff Lucovsky [Sun, 1 Dec 2019 18:15:34 +0000 (13:15 -0500)] 
detect/analyzer: Improved fast pattern display

When transforms are part of a rule, improve information displayed with
fast patterns to include the original buffer name and whether any
transform(s) are applied.

5 years agodetect/analyzer: Suppress direction warnings
Jeff Lucovsky [Wed, 27 Nov 2019 19:42:20 +0000 (14:42 -0500)] 
detect/analyzer: Suppress direction warnings

This commit suppresses direction warnings by the rules analyzer for ICMP
and ICMPV6 since it's not actionable.

5 years agostats: fix stats not always syncing in flow timeout
Victor Julien [Thu, 5 Dec 2019 08:20:31 +0000 (09:20 +0100)] 
stats: fix stats not always syncing in flow timeout

5 years agoapp-layer: validate TX detect flag callbacks 4405/head
Jason Ish [Wed, 27 Nov 2019 18:47:01 +0000 (12:47 -0600)] 
app-layer: validate TX detect flag callbacks

Check that both are set or unset.

5 years agoenip: add tx detect flags
Jason Ish [Wed, 27 Nov 2019 15:50:40 +0000 (09:50 -0600)] 
enip: add tx detect flags

5 years agodcerpc: add tx detect flags
Jason Ish [Tue, 26 Nov 2019 22:18:51 +0000 (16:18 -0600)] 
dcerpc: add tx detect flags

5 years agosnmp: add tx detect flags
Jason Ish [Tue, 26 Nov 2019 22:08:18 +0000 (16:08 -0600)] 
snmp: add tx detect flags

5 years agomodbus: add tx detect flags
Jason Ish [Tue, 26 Nov 2019 22:01:09 +0000 (16:01 -0600)] 
modbus: add tx detect flags

5 years agokrb5: register tx detect flags
Jason Ish [Thu, 21 Nov 2019 18:26:32 +0000 (12:26 -0600)] 
krb5: register tx detect flags

Related ticker #3345:
https://redmine.openinfosecfoundation.org/issues/3345

5 years agorust: define TxDetectFlag struct and binding macros
Jason Ish [Tue, 26 Nov 2019 19:25:04 +0000 (13:25 -0600)] 
rust: define TxDetectFlag struct and binding macros

Define a TxDetectFlag type and macros to generating C
bindings for getting and settings the tx detect
flags.

5 years agorust: add tx detect flags function to registration struct
Jason Ish [Tue, 19 Nov 2019 19:44:31 +0000 (13:44 -0600)] 
rust: add tx detect flags function to registration struct

5 years agoapp-layer: add tx detect functions to register struct
Jason Ish [Tue, 19 Nov 2019 19:42:24 +0000 (13:42 -0600)] 
app-layer: add tx detect functions to register struct

5 years agodetect-engine: check for tx detect flag support
Jason Ish [Mon, 25 Nov 2019 22:57:06 +0000 (16:57 -0600)] 
detect-engine: check for tx detect flag support

When registing a detection engine, check that the app-layer
protocol supports tx detect flags. Exit with a fatal
error if it does not as this is a code implementation
error that should be resolved during development.

5 years agoftpdata: add tx detect flags
Jason Ish [Mon, 25 Nov 2019 22:56:50 +0000 (16:56 -0600)] 
ftpdata: add tx detect flags

5 years agodebug: add SCReturnBool function exit macro
Jason Ish [Mon, 25 Nov 2019 22:55:08 +0000 (16:55 -0600)] 
debug: add SCReturnBool function exit macro

5 years agoapp-layer: method to see if parser supports tx detect flags
Jason Ish [Mon, 25 Nov 2019 22:51:44 +0000 (16:51 -0600)] 
app-layer: method to see if parser supports tx detect flags

Add method to check if a parser for an app-layer protocol
supports tx detect flags.

This is a bit of a hack for now as where we need to run
this check from we do not have the IP protocol.

5 years agogithub-actions: builds for our tier one linux distributions 4393/head
Jason Ish [Sun, 24 Nov 2019 05:36:48 +0000 (23:36 -0600)] 
github-actions: builds for our tier one linux distributions

Example of using GitHub actions to perform builds across
CentOS, Ubuntu, Debian and the latest Fedora.

5 years agompm: Fix typos and spelling errors
Jeff Lucovsky [Sat, 23 Nov 2019 19:47:11 +0000 (14:47 -0500)] 
mpm: Fix typos and spelling errors

5 years agodetect: Fix spelling errors
Jeff Lucovsky [Sat, 23 Nov 2019 19:43:41 +0000 (14:43 -0500)] 
detect: Fix spelling errors

5 years agodetect: Improve handling of variable values
Jeff Lucovsky [Sat, 23 Nov 2019 19:35:40 +0000 (14:35 -0500)] 
detect: Improve handling of variable values

When one of offset/depth/distance is from a variable, adjust the depth
by the offset as is done with scalar values at parse time.

5 years agodetect/mpm: Improved handling of variable values
Jeff Lucovsky [Sat, 23 Nov 2019 19:33:38 +0000 (14:33 -0500)] 
detect/mpm: Improved handling of variable values

This commit removes the offset and depth if either of these values are
dependent upon a byte-extract operation.

5 years agohttp: split request/response tx id handling
Victor Julien [Sat, 23 Nov 2019 21:25:02 +0000 (22:25 +0100)] 
http: split request/response tx id handling

When HTTP pipelining was in use, the transaction id used for events
and files could be off. If the request side was several requests ahead
of the responses, it would use the HtpState::transaction_cnt for events
and files, even though that is only incremented on complete requests.

Split request and response tx id tracking. The response is still handled
by the HtpState::transaction_cnt, but the request side is now handled by
its own logic.

5 years agofiles: remove FILE_USE_TRACKID flag
Victor Julien [Fri, 22 Nov 2019 15:32:43 +0000 (16:32 +0100)] 
files: remove FILE_USE_TRACKID flag

Once it was optional but as it no longer is it is no longer useful.

Remove it.

5 years agofiles: simplify pruning logic
Victor Julien [Fri, 22 Nov 2019 14:33:27 +0000 (15:33 +0100)] 
files: simplify pruning logic

Since ebcc4db84ac2c1957a6cc23b5154d7d6333f4cb8 the flow worker runs
file pruning after parsing, detection and loging. This means we can
simplify the pruning logic. If a file is in state >= CLOSED, we can
prune it. Detection and outputs will have had a final chance to
process it.

Remove the calls to the pruning code from Rust. They are no longer
needed.

5 years agoapp-layer: don't consider tx flags if not registered
Victor Julien [Fri, 22 Nov 2019 06:54:04 +0000 (07:54 +0100)] 
app-layer: don't consider tx flags if not registered

If a protocol does not support TxDetectFlags, don't try to use them.

The consequence of trying to use them was that a TX would never be
considered done, and it would never be freed. This would lead to excessive
memory use and performance problems due to walking an ever increasing
list.

5 years agosource-pcap-file: honor bpf filter on command line
Eric Leblond [Tue, 19 Nov 2019 16:21:10 +0000 (17:21 +0100)] 
source-pcap-file: honor bpf filter on command line

When a BPF filter is given on the command line when reading a
pcap file, the BPF filter is not honored.

The regression has been introduced in:

commit 3ab9120821e2b5cbc5925470bcfa5bcfb53f246b
Author: Dana Helwig <dana.helwig@protectwise.com>
Date:   Thu Apr 27 11:17:16 2017 -0600

    source-pcap-file: Pcap Directory Mode (Feature #2222)

Reported-By: Tim Colin <tcolin@et.esiea.fr>
5 years agosource-pcap-file: fix memory leak on pcap filter
Eric Leblond [Tue, 19 Nov 2019 16:28:05 +0000 (17:28 +0100)] 
source-pcap-file: fix memory leak on pcap filter

5 years agoutil: removes warning about double conversion
Philippe Antoine [Fri, 1 Nov 2019 07:48:56 +0000 (08:48 +0100)] 
util: removes warning about double conversion

From clang 10 :
implicit conversion from 'unsigned long' to 'double' changes value
from 18446744073709551615 to 18446744073709551616