From dad11f97ced3c9eb6e62a217c07ad05907038a20 Mon Sep 17 00:00:00 2001 From: "daniel.zatovic" Date: Mon, 3 Oct 2022 18:33:06 +0200 Subject: [PATCH] Copy only selected fuzzers to out directory. --- tests/fuzz/oss-fuzz-build.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/fuzz/oss-fuzz-build.sh b/tests/fuzz/oss-fuzz-build.sh index d83bc019..76a34d6e 100755 --- a/tests/fuzz/oss-fuzz-build.sh +++ b/tests/fuzz/oss-fuzz-build.sh @@ -29,6 +29,8 @@ export CFLAGS="${CFLAGS:-$flags} -I$DEPS_PATH/include" export CXXFLAGS="${CXXFLAGS:-$flags} -I$DEPS_PATH/include" export LDFLAGS="$LDFLAGS -L$DEPS_PATH/lib" +ENABLED_FUZZERS="crypt2_load_fuzz crypt2_load_proto_plain_json_fuzz" + mkdir -p $SRC mkdir -p $OUT mkdir -p $DEPS_PATH @@ -130,10 +132,14 @@ fi make clean make -j fuzz-targets -cp $SRC/cryptsetup_fuzzing/*_fuzz_seed_corpus.zip $OUT -cp tests/fuzz/*_fuzz $OUT -cp tests/fuzz/*_fuzz.dict $OUT -cp tests/fuzz/proto_to_luks2 $OUT -cp tests/fuzz/plain_json_proto_to_luks2 $OUT +for fuzzer in $ENABLED_FUZZERS; do + cp tests/fuzz/$fuzzer $OUT + cp $SRC/cryptsetup_fuzzing/${fuzzer}_seed_corpus.zip $OUT + + # optionally copy the dictionary if it exists + if [ -e tests/fuzz/${fuzzer}.dict ]; then + cp tests/fuzz/${fuzzer}.dict $OUT + fi +done cd $PWD