Commit Graph

17 Commits (d776d72711800168cda5d62a7cc4669abda379be)

Author SHA1 Message Date
Jason Ish 815396263b util/mime: use Rust md5 bindings instead of libnss
As the new Md5 hashing consumes its context on finalize, an bool
has_md5 flag has been added to let the logger know there is an
md5 hash available.
5 years ago
Jason Ish e50ee7eb62 filestore: remove requirement of nss for filestore
Required including NSS header in places that depended on
util-file.h including it.

All filestore suricata-verify tests now pass without libnss.

Also enabled detect-file{md5,sha1,sha256} without NSS support.
5 years ago
Philippe Antoine 293eebd999 fuzz: remove obsolete AFL code 6 years ago
Jeff Lucovsky 9a33b5d5de smtp/mime: Fix typos 6 years ago
Jeff Lucovsky 130b8d26e7 smtp/mime: Set event when name exceeds limit 6 years ago
Victor Julien 36e84b929c smtp/mime: fix null ptr deref on bad traffic
Due to missing error handling, a bad mime message could put the
mime parser in an error state, without the SMTP layer taking this
into account. So the SMTP layer would continue to pass data to the
mime parser, even though it was in an error state.

When the parser would be fed a very long line while in this state,
it would try to set an error flag in the state. However, due to
the error state, this setting of the flag would dereference a null
pointer.

This patch fixes this issue by updating the mime parser to check
the state it is in when receiving new input. It will refuse to
process futher data while in the error state. It will also return
a new error code to indicate to the SMTP layer that the parser
was in an error state.
7 years ago
Victor Julien bdaba1d815 QA: expose Mime decoding API to commandline using --afl-mime=<file> 10 years ago
Eric Leblond 484885b70f json-email-common: can now log same header twice
Multiple events can be applied on a transaction so we may need to
log the same header twice.

The HDR_IS_LOGGED flag was making it impossible. And this system
is usless as email application layer is transaction based.
10 years ago
Eric Leblond 2ecab3f765 decode-mime: fix body md5 computation
Previous code was wrongly supposing the lines are ending with CRLF.
But this is not the case so we must propagate the length of end of
line delimiter to be able to compute the md5 of the mail body.
10 years ago
Eric Leblond 7bb38f7c30 decode-mime: fix typo in comment 10 years ago
Eric Leblond 714c30a127 decode-mime: introduce MimeDecFindFieldsForEach
This patch introduces a new function that can be used to handle
multivalued MIME fields. A callback function can be called for
each corresponding field value.
10 years ago
Eric Leblond a233a982ea decode-mime: add function to get status
This new function return the textual status of MIME parsing.
10 years ago
Eric Leblond 9900558428 smtp: add 'body-md5' mime option
This option will allow the user to select weither or not he wants
to journalize the md5 of the mail body.
10 years ago
Eric Leblond d39009ca58 decode-mime: compute body md5
This patch is computing the md5 sum of the body of the MIME message.
This will allow to detect messages with same content and sent to
different people.
10 years ago
Victor Julien 6d170cadd7 smtp: fix mime boundary parsing issue
If a boundary was longer than 254 bytes a stack overflow would result
in mime decoding.

Ticket #1449

Reported-by: Kostya Kortchinsky of the Google Security Team
11 years ago
Victor Julien f979e92f68 decode mime: refactor & cleanup
Partly to work around cppchecks:
[src/util-decode-mime.c:1085]: (error) Memory leak: url
11 years ago
Victor Julien 54df86658c mime: rename mime-decode.[ch] to util-decode-mime.[ch] 11 years ago