Skip to content

Latest commit

 

History

History
 
 

fuzz

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Fuzz testing

This folder contains utilities to carry out fuzz testing. Currently only Honggfuzz is supported. Heavily inspired by the fuzz testing setup of rust-lightning.

Running

Generate the fuzzing code:

pushd src/bin
./gen_msgs_fuzz.sh
popd
HFUZZ_RUN_ARGS="--exit_upon_crash" cargo hfuzz run offerdlc_fuzz

(replace with whichever target you want to fuzz)

Running through docker

A docker image is provided to run honggfuzz on it. To build it, from the repository root directory run:

docker build . -f fuzz/Dockerfile -t dlcfuzz

You can then use it to fuzz as follow:

docker run --rm -it dlcfuzz offerdlc_fuzz

(replacing with whichever target you want to fuzz)

You can alter the hongfuzz arguments using the HFUZZ_RUN_ARGS environment variable, e.g.:

docker run --rm -it -e HFUZZ_RUN_ARGS='--exit_upon_crash -t 10' dlcfuzz offerdlc_fuzz