run-mode: remove duplicate var; add setter function
Remove the global "run_mode" var as it was a duplicate of the runmode on
the "instance" struct. For direct access outside of suricata.c, use the
getter function.
Also expose a setter function for unit tests that need to change it.
a2502c9...
by
Shivani Bhardwaj <email address hidden>
util/base64: add more tests to increase coverage
4c131a4...
by
Shivani Bhardwaj <email address hidden>
util/mime: check invalidity after final b64 block
Since there is code in place that skips over invalid base64 characters
and creates a new array out of the remainder vector, all test must be
made after that final array has been created and against the variable
that holds the actual length of the final array.
884400f...
by
Shivani Bhardwaj <email address hidden>
util/mime: skipped chars should be marked consumed
a573881...
by
Shivani Bhardwaj <email address hidden>
util/base64: use real numbers in test vectors
76de3d9...
by
Shivani Bhardwaj <email address hidden>
util/base64: update tests to correct consumed bytes
Also, don't treat a successful decoding that had invalid characters as
errors. The caller does not treat them as errors so it makes sense to
consider it successful if something was decoded.
885d540...
by
Shivani Bhardwaj <email address hidden>
util/base64: add base64 decode fns per RFC
Base64 decoder tried to handle several different cases in one fn
including how the data should be decoded and corresponding consumed and
decoded bytes calculated for RFC 2045 and RFC 4648 which are very
different. This left window for mistakes and edge cases that one mode is
not supposed to take care of while the other can.
Separate the decoder per RFC so as to have each variable their own scope
and playground. This also makes it much easier to debug if there are any
issues in decoding w.r.t. different callers.
This also takes care of some known issues like making sure the consumed
bytes are correctly handled.