Skip to content
  • Denis Kasak's avatar
    Support building a "disarmed" target via the OLM_FUZZING macro. · 0a8bbde3
    Denis Kasak authored
    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.
    
    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.
    0a8bbde3