Skip to content

Support building a "disarmed" target via the `OLM_FUZZING` macro.

Denis Kasak requested to merge dkasak/disarmed-variant-support-for-fuzzing into master

Like other crypto libs, libolm contains many obstacles which a fuzzer is unlikely to be able to surmount but which are not important for the end goal of fuzzing. The easiest and most robust way around this is to remove these obstacles conditionally when building the fuzzer binaries.

This commit adds a preprocessor macro OLM_FUZZING which can be used to conditionally disables problematic bits of code during compile-time for easier fuzzing. For ease of reference, I'm calling such a variant of the code "disarmed" (as in the MR title).

Currently the only thing it disables is the encryption/decryption and base64 encoding/decoding when processing pickled Megolm keys. This allows the fuzzers to fuzz the unpickling functionality directly without inadvertently fuzzing the base64 encoder and encryption (which should be fuzzed separately).

The macro is set in the Makefile only when building fuzzer binaries.

Merge request reports