Commit Graph

25 Commits (debc1a6334bdd9f37ccd043b6e3fe57b9c549d5d)

Author SHA1 Message Date
Victor Julien c89ce17017 afl: with -Wshadow issues 9 years ago
Tom DeCanio 04faf1a93a util-decode-mime: remove quote from boundary= string.
remove quote from the end of the boundary= string.  This was throwing off
the mime parser so that it wouldn't always catch mime boundaries causing
things like missed attachments.
9 years ago
Victor Julien 48771c1acf debug: fix compiler warnings 10 years ago
Victor Julien c64815e4a8 decode-mime: don't call memcpy on NULL pointer 10 years ago
Victor Julien 19d112ba07 smtp/mime: allow unquoted name/filename fields
Don't enforce that name/filename fields are quoted.

Reported-By: Blair Steven
10 years ago
Mats Klepsland 45d87d66c0 afl: add support for AFL PERSISTANT_MODE
Add support for AFL PERSISTANT_MODE when Suricata is compiled with
a supported compiler (only afl-clang-fast for now).

This gives a ~10x performance boost when fuzzing.
10 years ago
Victor Julien bdaba1d815 QA: expose Mime decoding API to commandline using --afl-mime=<file> 10 years ago
Jason Ish 796dd5223b tests: no longer necessary to provide successful return code
1 pass, 0 is fail.
10 years ago
Jason Ish 52983bf314 tests: convert all test to return 0 on failure, 1 on success 10 years ago
Jason Ish 9375e8fb3c util-base64: strict mode - all characters must be valid
Introduce a strict mode to base64 decode. If strict,
the function will fail when invalid input data is seen.
If not strict, what has been decoded will be returned.

This is in support of adding a Snort compatible base64_decode
rule option that uses whatever data can be decoded as a length
of data to decode is optional.
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 53419b93c8 util-decode-mime: fix some unittests
Unittests were failling when ASAN is activated because it was
finding some read outside of bounds. This patch fixes the different
reported issues.
10 years ago
Eric Leblond dbb3e1976e util-decode-mime: fix IsIpv6Host function
Using in6_addr is better when calling inet_pton. This fixes an
issue reported by ASAN.
10 years ago
Eric Leblond 6f033747ec util-decode-mime: add unittests for field fetching 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 9d2a0c39e5 mime: fix output issues
When multiple email addresses were in the 'to' field, sometimes
they would be logged as "\r\n \"Name\" <email>".

The \r\n was added by GetFullValue in the mime decoder, for unknown
reasons. Disabling this seems to have no drawbacks.
11 years ago
Victor Julien ebd6737b65 mime: fix compiler warning 11 years ago
Victor Julien 20a175f315 mime: improve error checking 11 years ago
Victor Julien cb4440324e mime: redo PrintChars using PrintRawDataFp 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