Commit Graph

2245 Commits (3564f2f92885e856bffa7d3a54db431c70805756)

Author SHA1 Message Date
Jason Ish e9611a4d7c output-eve: bindgen SCRegisterEveFileType to Rust
Used by Rust output plugins.
5 months ago
Jason Ish 1b182025bc output-eve: expose SCEveFileType to Rust with bindgen
There is an unfortunate side-affect that one has to read
output-eve-bindgen.h for the documentation on this type, however, I
think we can resolve that in time.
5 months ago
Philippe Antoine 536242341b detect/smb: move smb.version keyword to rust
Ticket: 8267
5 months ago
Philippe Antoine df495d7e22 rust: bindgen SCDetectGetLastSMFromLists
to use it from rust keywords
5 months ago
Philippe Antoine 697c641400 detect/smb: move smb share and named_pipe keywords to rust
Ticket: 8267
5 months ago
Philippe Antoine 667f8b2eb7 detect/smb: move smb ntlmssp keywords to rust
Ticket: 8267
5 months ago
Victor Julien a2e9ac21f8 flow: turn flags field into uint64_t
Entire space is used.
5 months ago
Jason Ish b0c912588c mqtt/detect: fix mqtt_parse_bool return type
Previously we were boxing a u8 and returning it as a pointer to a
boolean. While this is probably not an issue itself, the value 2 was
allowed to be converted to a boolean, which is undefined behavior in
Rust.
5 months ago
Jason Ish b9e0f9cc8b rfb/detect: fix rfb_parse_sec_result return type
The data parsed is a u32, but returned as DetectUintData<u8>, then
later free'd as a DetectUintData<u32>.
5 months ago
Jason Ish 8b2a7ac47c nfs/detect: fix nfs_procedure_parse return type
Was returning DetectNfsProcedureData as a pointer to
DetectUintData<u32>, and free'ing it as such.
5 months ago
Jason Ish e474e45429 dns/detect: fix rcode return type
The parsed DNS rcode was being returned as a DetectUintData<u8>, but is
parsed, and free'd as a u16. So return a DetectUintData<u16>.
5 months ago
Jason Ish c7f806a728 rust/sys: allow unknown lints
allow(unpredictable_function_pointer_comparisons) is needed on newer
versions of Rust, but is unknown to our MSRV, so for now, allow unknown
lints.
5 months ago
Philippe Antoine 364d2c077d rust: bindgen SCAppLayerRegisterParser
Ticket: 7662
6 months ago
Philippe Antoine 8401417a84 app-layer: remove some obsolete forward declarations
and reorder definitions
6 months ago
Philippe Antoine 8857b78f6a rust: move AppLayerTxData definition to C
and bindgen it to rust

Will make easier the bindgen of RustParser structure which uses
a callback which uses AppLayerTxData

Move also the free function to C SCAppLayerTxDataCleanup
As suricata-sys crate defines AppLayerTxData for rust,
It must itself implement the Drop trait, and thus,
We need to define a feature surest
6 months ago
Philippe Antoine 8eaced3c1e rust: move AppLayerResult definition to C
and bindgen it to rust

Will make easier the bindgen of RustParser structure which uses
a callback which uses AppLayerResult

Keep From<> impl in sys crate that defines it
6 months ago
Philippe Antoine 06f78b2a22 rust: move StreamSlice definition to C
and bindgen it to rust

Will make easier the bindgen of RustParser structure which uses
a callback which uses StreamSlice
6 months ago
Philippe Antoine 41f543ca35 rust: move AppLayerGetTxIterTuple definition to C
and bindgen it to rust

Will make easier the bindgen of RustParser structure which uses
a callback which uses AppLayerGetTxIterTuple
6 months ago
Philippe Antoine 64d29fcd1c rust: move AppLayerStateData definition to C
and bindgen it to rust, and use default trait instead of new

Will make easier the bindgen of RustParser structure which uses
a callback which uses AppLayerStateData
6 months ago
Philippe Antoine 76efb8af4d rust: move AppLayerGetFileState definition to C
and bindgen it to rust.

Will make easier the bindgen of RustParser structure which uses
a callback which uses AppLayerGetFileState
6 months ago
Philippe Antoine fc23e54c6d rust: bindgen with derive eq
As will be needed such as AppLayerTxData
6 months ago
Shivani Bhardwaj d4008a6508 dcerpc: remove bad tests
Unittests test_parse_bind_pdu_infinite_loop and
test_parse_bindack_pdu_infinite_loop seem to have artificially made up
header which does not hold up to the strict calculations enforced by the
parser now. Their headers mark the fraglens as 64 and 72 respectively
which are not enough to hold the kind of bind(ack) items that are expected.
It worked so far as the parser passed the entire input slice around but
with the bugfix for issue 7546, the input passed around is strictly
restricted to the fraglen parsed in the header.

Bug 7546
6 months ago
Shivani Bhardwaj ed1bd8624e dcerpc: use fraglen from header
So far, the fraglen defined in the header was used inconsistently in
certain places to define bounds on input length. Make it consistent by
making sure that only a slice up until fraglen is passed around as that
is the maximum length the fragment should have.
With the help of Applayer::incomplete API, the case when the
stream_slice passed to the parser is smaller than the header defined
fraglen is already handled.

Bug 7546
6 months ago
Shivani Bhardwaj fc9da1c7a1 dcerpc: fix consumed bytes post gap handling
The parser could receive an input that consists of arbitrary data post
gap. This is handled in the beginning of the fn handle_input_data.
However, the rest of the calculation does not take into account the
bytes that were consumed at this stage. Fix the indices and calculations
to consider a new DCERPC fragment beginning post these consumed bytes.
6 months ago
Philippe Antoine 9a52bbcbe9 detect/quic: move quic.cyu.hash to rust
Ticket: 8255
6 months ago
Philippe Antoine 01610aabe7 detect/quic: move quic.cyu.string to rust
Ticket: 8255
6 months ago
Philippe Antoine ee4d4a14d5 detect/quic: move quic.ua to rust
Ticket: 8255
6 months ago
Philippe Antoine 9ba9fdcb87 detect/quic: move quic.sni to rust
Ticket: 8255
6 months ago
Philippe Antoine 907e71a984 detect/quic: move quic.version to rust
Ticket: 8255
6 months ago
Philippe Antoine 7dbe033ae0 app-layer: function to register ci pattern + probe
Ticket: 6591
6 months ago
Philippe Antoine 2cf9a327d5 detect/ssh: move ssh.hassh to rust
Introduces helper SCDetectRegisterBufferLowerMd5Callbacks
6 months ago
Philippe Antoine 83360cfce0 detect/ssh: move ssh.hassh string to rust
bindgen needed SCSigMatchSilentErrorEnabled on the way
6 months ago
Philippe Antoine 02cb0f2ac2 rust: fix unnecessary_unwrap warnings
warning: called `unwrap` on `rd.pipe` after checking its variant with `is_some`
   --> src/smb/smb1.rs:858:28
    |
857 |             if rd.pipe.is_some() {
    |             -------------------- help: try: `if let Some(<item>) = rd.pipe`
858 |                 let pipe = rd.pipe.unwrap();
    |                            ^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_unwrap
    = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
6 months ago
Philippe Antoine cafc398355 dcerpc: consume bytes after gap resync
Ticket: 7567

Re-applies commit 8c3bd3e8a0
which was reverted in f64aec9d11
6 months ago
Philippe Antoine 54cc752cf9 ssh: hassh can be truly disabled
Rules will not re-enable it

Ticket: 8223
6 months ago
Philippe Antoine 458211dcf2 detect/ssh: move ssh.proto to rust 6 months ago
Philippe Antoine 9cfc1cc557 detect/ssh: move obsolete keywords to rust 6 months ago
Philippe Antoine ea8ac2a02a detect/ssh: move ssh.software to rust
Adds helper function SCDetectHelperBufferProgressMpmRegister on the way
6 months ago
Philippe Antoine c0d6747e82 app-layer: GetTxIteratorFn uses a AppLayerGetTxIterState
Even if every current rust parser uses the u64 variant of the C union
6 months ago
Philippe Antoine 4b541b39f2 rust: move AppLayerEventType definition to C
and bindgen it to rust.

Will make easier the bindgen of RustParser structure which uses
a callback which uses AppLayerEventType
6 months ago
Philippe Antoine c960b7d7c1 app-layer: AppLayerParserFPtr uses a mut pointer to local storage
So, fix the fn prototype in rust ParseFn
6 months ago
Philippe Antoine f470ee448b quic: use standard tx iterator code
Will make bindgen life easier

As the fn prototype should not have istate: &mut u64
but a *mut AppLayerGetTxIterState which is an union with a u64
6 months ago
Philippe Antoine 076fcd61cd bittorrent: use standard tx iterator code
Will make bindgen life easier

As the fn prototype should not have istate: &mut u64
but a *mut AppLayerGetTxIterState which is an union with a u64
6 months ago
Philippe Antoine 1a546936c7 rust: AppLayerTxConfig uses Default impl 6 months ago
Philippe Antoine 4e64de3b3b rust: remove wrapper LoggerFlags struct definition
just use an u32 out of the box.
Will make bindgen like easier
6 months ago
Philippe Antoine f663be5983 rust: define every RustParser fn pointer unsafe
That is what bindgen will do
6 months ago
Lukas Sismis 3e4fdb2118 misc: time unit parsing function 6 months ago
Philippe Antoine 5bb9a0c3af dcerpc/tcp: fix fragmentation handling
Really count the fragments, and set it done when last was received
6 months ago
Philippe Antoine f64aec9d11 dcerpc: use different header for different directions
Header handling is wrong in the case
packet A to server is fragmented (return AppLayerResult::incomplete)
packet B is to client, but uses the header of the to_server packet

Bug 7547
6 months ago
Philippe Antoine 1832b50506 nfs: log read/write/rename whatever the nfs version
These were previously logged correctly only for nfs v3

Now, the correct opcodes are used for v2 and v4 as well

Ticket: 8222
6 months ago
Philippe Antoine b0850efd67 rust: from_str implementation for EncryptionHandling
To move non-specific quic code to the right place
6 months ago
Philippe Antoine 89b6ab6730 rust: rename EncryptionHandling
as it is no longer specific to SSH
6 months ago
Philippe Antoine 7acfea57a9 rust: move EncryptionHandling definition to its own file
as it is not specific to ssh anymore
6 months ago
Philippe Antoine 7422c97bf2 quic: encryption-handling config parameters
Ticket: 8116
6 months ago
Victor Julien ff3def130c rust/htp: formatting fixup 6 months ago
Victor Julien b1fe6a4ceb rust: update lru to 0.16.3; update lock
RUSTSEC-2026-0002

Ticket: #8210.
6 months ago
Philippe Antoine a48200b9e5 dcerpc: use saturating_add to count fragments
And do not overflow if we have traffic with more than 65K fragments
6 months ago
Shivani Bhardwaj e412215af9 dcerpc: add upper limit on stub data
DCERPC parsers had no upper bounds when it came to extending the stub
data buffer. Traffic can be crafted to bypass some internal parser
conditions to create an indefinite buffering in the stub_data array that
can make Suricata crash.

Add a default limit of 1MiB and make it configurable for the user.

Security 8182

Co-authored-by: Philippe Antoine <pantoine@oisf.net>
6 months ago
Philippe Antoine fa5a4a994a http: limit the number of folded lines per header
Ticket: 8201

Limits the quadratic complexity if each packet, restarting the
header parsing, just adds a new folded line.
This was previously bounded by the configurable max header length
6 months ago
Philippe Antoine f2a45c4216 http: do not use recursion in decompression
just loop and iterate

Ticket: 8185
7 months ago
Shivani Bhardwaj 1d7b0d9b7a tls/subjectaltname: use byte arr instead of string
TLS parsers use x509-parser crate which parses X.509 certificates that
use ASN.1 DER encoding that can allow arbitrary byte sequences. An
attacker could inject null byte in a certificate anywhere to stump the
common language parsers terminating the string at a null byte leading to
a bypass of a possibly malicious certificate.

So far, the rust TLS parser for "subjectaltname" used a pattern that involved:
-> Get ASN.1 DER encoded raw data from the x509-parser crate
-> Convert this raw data to a decoded string (Rust)
-> Convert the Rust string to CString
-- The problem lies here. CString only accepts proper strings/byte
buffers and converts it into an owned C-compatible, null-terminated
string. However, if any null byte occurs in the string passed to the
CString then it panics.
In the rust TLS parser, this panic is handled by returning NULL.

This means that the parser will error out during the decoding of the
certificate. However, Suricata must be able to detect the null byte
injection attack being an IDS/IPS.

Hence, replace all such string patterns w.r.t. TLS SAN with a byte
array.

Bug 7887
7 months ago
Shivani Bhardwaj 24f5b7dab2 tls/serial: use byte array instead of string
Bug 7887
7 months ago
Shivani Bhardwaj f025e07191 tls/issuerdn: use byte array instead of string
TLS parsers use x509-parser crate which parses X.509 certificates that
use ASN.1 DER encoding that can allow arbitrary byte sequences. An
attacker could inject null byte in a certificate anywhere to stump the
common language parsers terminating the string at a null byte leading to
a bypass of a possibly malicious certificate.

So far, the rust TLS parser for "issuerdn" used a pattern that involved:
-> Get ASN.1 DER encoded raw data from the x509-parser crate
-> Convert this raw data to a decoded string (Rust)
-> Convert the Rust string to CString
-- The problem lies here. CString only accepts proper strings/byte
buffers and converts it into an owned C-compatible, null-terminated
string. However, if any null byte occurs in the string passed to the
CString then it panics.
In the rust TLS parser, this panic is handled by returning NULL.

This means that the parser will error out during the decoding of the
certificate. However, Suricata must be able to detect the null byte
injection attack being an IDS/IPS.

Hence, replace all such string patterns w.r.t. TLS IssuerDN with a byte
array.

Bug 7887
7 months ago
Shivani Bhardwaj 77c21b05d2 tls/subject: use byte array instead of string
TLS parsers use x509-parser crate which parses X.509 certificates that
use ASN.1 DER encoding that can allow arbitrary byte sequences. An
attacker could inject null byte in a certificate anywhere to stump the
common language parsers terminating the string at a null byte leading to
a bypass of a possibly malicious certificate.

So far, the rust TLS parser for "Subject" used a pattern that involved:
-> Get ASN.1 DER encoded raw data from the x509-parser crate
-> Convert this raw data to a decoded string (Rust)
-> Convert the Rust string to CString
-- The problem lies here. CString only accepts proper strings/byte
buffers and converts it into an owned C-compatible, null-terminated
string. However, if any null byte occurs in the string passed to the
CString then it panics.
In the rust TLS parser, this panic is handled by returning NULL.

This means that the parser will error out during the decoding of the
certificate. However, Suricata must be able to detect the null byte
injection attack being an IDS/IPS.

Hence, replace all such string patterns w.r.t. TLS Subject with a byte
array.

Bug 7887
7 months ago
Shivani Bhardwaj 06eafb79d6 detect/flow-pkts: check for both dir
The functionality of "both" can already be easily achieved by using both
"toclient" and "toserver" in a rule. This just adds the ease of
expression in rule. As it is added now, check the direction for the
pre-existing users of direction as well.
7 months ago
Shivani Bhardwaj 77abcde9ee rust/flow: add public wrapper for dir
in order to be able to use it on the C side for elephant flow detection.
7 months ago
Jason Ish d89b35db56 conf: add SCConfNodeChildValueIsFalse to check for false value
New function to check is a value is actually set to a false value.
7 months ago
Philippe Antoine af246ae7ab http: do not use a loop to find the tx count
As we want the last tx

Ticket: 8156

The generic function AppLayerParserGetTxCnt calls for HTTP1
Transactions.size()

This function has some specific code, as we may have pre-created
a tx that we do not want to count.
This used to get the last tx by iterating over all the transactions
waiting to find the one with max index.
So, instead of using the Transactions.get function, we get the last
tx out of the VecDeque and check its index.
7 months ago
Jeff Lucovsky 9c81f817e8 rust: bindgen update
Issue: 7389

Update bindgen with `make update-bindgen`
7 months ago
Jason Ish 50224f2ee5 rust: fix clippy warning for unused import
While debug_validate_bug_on is still used, it does not need to be
imported directly, as that macro is marked with `macro_export`, making
it globally available to the crate.
7 months ago
Philippe Antoine 455b7d1b3b rust: use snake case for applayer_register_protocol_detection 7 months ago
Philippe Antoine b4d8aea0ae rust: bindgen SCAppLayerRegisterProtocolDetection
Ticket: 7662

Changing the struct passed to it to have the minimal number
of useful fields.
7 months ago
Philippe Antoine 1329786f84 detect: new command line option : list-rule-protos
To list the protocols we can use a in a rule header

Ticket: 635
8 months ago
Philippe Antoine 2349f19977 nfs: use nfsv2 procedure names with nfs_procedure keyword
Ticket: 5140
8 months ago
Jhonny Sousa 257ed82dbd nfs: Fix NFSv2 STATFS procedure parsing
Ticket: #5140
8 months ago
Philippe Antoine 15b1bf4865 rust: bindgen SCHTPFileCloseHandleRange
Ticket: 7762
8 months ago
Philippe Antoine cddbd0b906 rust: bindgen more file functions
Ticket: 7762
8 months ago
Philippe Antoine 327b8b04a9 rust: bindgen with default derive
Ticket: 7762
8 months ago
Victor Julien 80d5afe91b pop3: AUTH command handling improvements
Better track the state so it's known when to expect a base64 request
message. Also better validate the base64.

Ticket: #7994.
8 months ago
Victor Julien 2973eded56 pop3: convert to nom 8
Ticket: #8127.
8 months ago
Victor Julien da2db65f62 pop3: rustfmt 8 months ago
Jason Ish 83d8b1d2f8 quic: update to nom 8.0
Ticket: #8140
8 months ago
Philippe Antoine 32ce3d29be detect/krb: use flag u32 for krb5_msg_type 8 months ago
Jason Ish a9eee5dfd9 rust/htp: convert to nom 8
Ticket: #8090
8 months ago
Jason Ish ef9cd7beff rust/smb: convert to nom 8
Ticket: #8089
8 months ago
Jason Ish 02045e1d62 rust/dcerpc: convert to nom 8
Ticket: #8093
8 months ago
Jason Ish 25c98af0e8 rust/detect: convert remaining detection rule parsers to nom 8
Ticket: #8051
8 months ago
Jason Ish dea3f9e260 rust/detect: convert error.rs and dependent parsers to nom 8
Ticket: #8051
8 months ago
Jason Ish efc32dea41 rust/detect: convert uint nom 8
And users of uint directly impacted by this change.

Ticket: #8051
8 months ago
Jason Ish cf604751de rust/util: convert to nom 8
Ticket: #8088
8 months ago
Jason Ish 1e01d5adca rust/conf: convert to nom 8
Ticket: #8087
8 months ago
Jason Ish c6e8932740 rust/asn1: convert to nom 8
Ticket: #8086
8 months ago
Jason Ish 59f8fb30a8 rust/ftp: fix clippy warning
error: implicitly casting the result of `from_raw_parts_mut` to `*mut [u8]`
        --> src/ftp/response.rs:107:31
8 months ago
Philippe Antoine cba13ed9b1 rust: bindgen functions needed for datasets
Ticket: 7762
8 months ago
Philippe Antoine 12892ba010 rust: bindgen functions neede for features
Ticket: 7762
8 months ago
Jeff Lucovsky e1bf5cb1f3 nfs: Support EXCLUSIVE4_1 flag
Issue: 8006

Support the EXCLUSIVE4_1 create mode added to NFS 4.1
9 months ago
Philippe Antoine 79e66f76e6 detect: icmp_id is now a generic integer
Ticket: 7889
9 months ago
Philippe Antoine 85fa894425 detect: dnp3.func is now a generic integer
Ticket: 7889
9 months ago
Philippe Antoine f2b6540c52 htp: bound decompression
Ticket: 7980

Usage of Vec<u8> instead of Box<u8> gave the ability to callers
to grow the buffer (indefinitely)
This was regressed in 16fee33368

Additionnaly, use rust WriteZero instead of WouldBlock as a more
fitting error when cursor is full, as that error kind is the
one tested by callers.
9 months ago
Philippe Antoine c61f1cb6d0 detect/integers: rename index all1 to all
And all to all_or_absent

Ticket: 7929
9 months ago
Philippe Antoine eb5a2d646b detect/vlan: move vlan.id keyword to generic integer
Ticket: 7929
9 months ago
Li Heng c141c55bc6 snmp: can be set to detection-only
Realloc alp_ctx.ctxs when a dynamic alproto is registered and
g_alproto_max increases. So dynamic alproto can be treated as
real/normal ones. And app-layer switch can be set to any value
of no/deteciton-only/yes.

Ticket: 8000
9 months ago
Philippe Antoine 439f96dea7 rust: bindgen frames functions
Ticket: 7667
9 months ago
Philippe Antoine 92c7be1cb6 rust: bindgen SCSRepCatGetByShortname
Ticket: 7667
9 months ago
Philippe Antoine 7447651fa0 output/jsonbuilder: helper function SCJbSetPrintAsciiString
To replace C PrintStringsToBuffer and avoid a stack alloc
+ copy

Ticket: 8004
9 months ago
Li Heng 1106323ae1 rust/sip: delete redundant computing codes
Delete call of is_alphanumeric where is_alphanumeric and
is_token_char are called together. Four places are modified.

Ticket: 8003
9 months ago
Jason Ish 1efe70a234 rust/ike: convert to nom 8
Ticket: #8050
9 months ago
Jason Ish f368324e87 rust/mime: convert to nom 8
Ticket: #8048
9 months ago
Jason Ish c5ef615953 rust/mqtt: convert to nom 8
Ticket: #8047
9 months ago
Jason Ish 2289069f74 rust/websocket: convert to nom 8
Ticket: #8046
9 months ago
Jason Ish 9eeefd0684 rust/bt-dht: convert to nom 8
Ticket: #8045
9 months ago
Jason Ish 399f96b07d rust/rdp: convert to nom 8
Ticket: #8044
9 months ago
Jason Ish 7c70f74942 rust/telnet: convert to nom 8
Ticket: #8043
9 months ago
Jason Ish 2ff2eb1325 rust/ssh: convert to nom 8
Ticket: #8042
9 months ago
Jason Ish baa22287b8 rust/rfb: convert to nom 8
Ticket: #8041
9 months ago
Jason Ish dcfe247467 rust/pgsql: convert to nom 8
Ticket: #8039
9 months ago
Jason Ish d25286e77a rust/enip: convert to nom 8
Ticket: #8038
9 months ago
Jason Ish d74f8522ee rust/tftp: convert to nom 8
Ticket: #8037
9 months ago
Jason Ish 4b09622ebc rust/dhcp: convert to nom 8
Ticket: #8036
9 months ago
Philippe Antoine 772bd9ca53 rust: reduce visibility of detect_parse_uint_notending
It is meant as an internal function

Also document the function
9 months ago
Philippe Antoine b636dffd5b detect: urilen keyword fails on trailing junk
Fails especailly on 1<>2 which looks like a range, but is invalid
as too small, and ended up being accepted as =1

Ticket: 8028
9 months ago
Philippe Antoine 2e9027fd5a plugins: update SC_API_VERSION to 9
So that plugins built for 8 will fail to load with 9 as there
were already breaking changes in the structures and functions
prototypes
9 months ago
Jason Ish 16d313cb8b rust/applayertemplate: convert to nom 8
Ticket: #8027
9 months ago
Jason Ish f0f4d88119 rust/sip+sdp: update to nom 8
Done together as there is a dependence of SDP by SIP.

Ticket: #8025
9 months ago
Jason Ish 58564a4b0e rust/ftp: update to nom 8
Ticket: #8026
9 months ago
Jason Ish 54cc97b78e rust/dns: convert to nom 8.0
Ticket: #8024
9 months ago
Jason Ish 16c42da57e rust: add nom8 as a dependency
For the update from nom 7 to nom 8.
9 months ago
Jason Ish 0990c9dbf6 rust: pin indexmap
Newer indexmap, pulled in by serde_json requires Rust 1.82, so pin
pack to 2.11.4 which still works with Rust 1.75.
9 months ago
Philippe Antoine dc7874b2ac rust: bindgen more http range functions used in http2
Ticket: 7667
9 months ago
Philippe Antoine 842352c190 rust: bindgen SCHttpRangeFreeBlock
Ticket: 7667
9 months ago
Philippe Antoine 93785ae357 rust: bindgen SCHTTP2MimicHttp1Request
Ticket: 7667
9 months ago
Philippe Antoine a1613fecb4 detect: tcp.flags rejects non-sensical values
ignored flags are only meaningful for equal mode
9 months ago
Philippe Antoine 31e9cb55be detect: tcp.flags unit tests improvements
Tests better the ignored flags functionality.
This functionality is only used at detection for default mode,
it is not used for any, plus or not mode.

So, have unit tests about igored flags with default mode with
both matching and non matching cases
9 months ago
Philippe Antoine d8cb00e795 detect/tcp: make tcp.flags a generic integer with bitflags
Ticket: 6724

Allows to use numerical values for example

Also fixes some unit tests that were returning 1 after goto error
FlagsTestParse05 especially took this path as
de->ignored_flags != (TH_SYN|TH_RST) was false
we had de->ignored_flags == 0xff ^ (TH_SYN|TH_RST)
And then, we had a match, instead of what the not-run code
was supposing.
9 months ago
Philippe Antoine 1f9236a6d8 detect/ipv4: make fragbits a generic uint16 bitflags keyword
Ticket: 6724

Allows to use numerical values
9 months ago
Philippe Antoine 633180c93f detect/integers: generalize support for bitflags modifier
Ticket: 6724

Allows sugar syntax for bitflags keywords.
While the expressivity does not increase, because we could already
use numerial values with all generic integer modes, this modifier
prefix is used with the strings, and follows the syntax
that is already used for fragbits and tcp.flags keyword.
9 months ago
Philippe Antoine f25194480c libhtp: fix newer clippy lints with newer MSRV 9 months ago
Jason Ish bc33bd49eb quic/crypto: remove use of GenericArray
Its not needed, and gets rid of the deprecation warnings.
9 months ago
Jason Ish bdfdf7ff33 rust: update deps with cargo-update
Suppress deprecation warnings in quick/crypto.rs about GenericArray.
9 months ago
Jason Ish 6fdf0d736b rust: update aes-gcm to 0.10.3 9 months ago
Jason Ish b9517de86e rust: update aes to 0.8.4 9 months ago
Philippe Antoine 4b69a31dc3 detect/integers: count argument for multi-integers
Ticket: 7211

Allows to count the number of elements, without matching on
individual elements
9 months ago
Philippe Antoine 3babd68af4 pop3: count retr_data into consumed
for later AppLayerResult::incomplete

Fixes: acef961645 ("pop3: improve parsing")

https://issues.oss-fuzz.com/u/1/issues/451112373

Ticket: 7994
9 months ago
Philippe Antoine 9a4a29e218 http2: fix parsing of goaway frames
There was a last stream id before the error code
As per section 6.8 of RFC 7540

Ticket: 7991
9 months ago
Philippe Antoine 7f0087f19a rust/detect: fix correct pointer type in SCDetectU32ArrayFree 9 months ago
Philippe Antoine 969739d067 detect: http2.errorcode is now a generic integer
Ticket: 7889
9 months ago
Philippe Antoine 401b2fcae6 detect: http2.frametype is now a generic integer
Ticket: 7889
9 months ago
Philippe Antoine 454f73b445 rust: EnumString derive accepts a enum_string_style parameter
So that http2.frametype and http2.errorcode can use EnumString
without changing the format, as they used UPPERCASE instead of
the default EnumString snake_case
9 months ago
Victor Julien acef961645 pop3: improve parsing
Improve multiline commands and SASL auth.

Work around missing support in crate for empty server challenge and SASL base64 data.

Ticket: #7709.
10 months ago
Jason Ish 5e2dc9ace3 ike: don't log empty server objects 10 months ago