From 3d5478c653ead0ebd4f6020da18df2884de96c5c Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Fri, 14 Aug 2020 12:53:56 -0500 Subject: [PATCH] [rnp] Generate input corpus (#4322) --- projects/rnp/build.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/projects/rnp/build.sh b/projects/rnp/build.sh index e31c3b49b..bee2e13e8 100755 --- a/projects/rnp/build.sh +++ b/projects/rnp/build.sh @@ -15,6 +15,8 @@ # ################################################################################ +ORIG_DIR=$(pwd) + wget -qO- https://botan.randombit.net/releases/Botan-2.12.1.tar.xz | tar xvJ cd Botan-2.12.1 ./configure.py --prefix=/usr --cc-bin=$CXX --cc-abi-flags="$CXXFLAGS" \ @@ -23,7 +25,14 @@ cd Botan-2.12.1 --with-fuzzer-lib='FuzzingEngine' make make install -cd .. + +cd $ORIG_DIR +mkdir fuzzing_corpus + +cd rnp/src/tests/data +find . -type f -print0 | xargs -0 -I bob -- cp bob $ORIG_DIR/fuzzing_corpus/ + +cd $ORIG_DIR # -DENABLE_SANITIZERS=0 because oss-fuzz will add the sanitizer flags in CFLAGS # See https://github.com/google/oss-fuzz/pull/4189 to explain CMAKE_C_LINK_EXECUTABLE @@ -47,6 +56,7 @@ FUZZERS="fuzz_dump fuzz_keyring" for f in $FUZZERS; do cp src/fuzzing/$f "${OUT}/" chrpath -r '$ORIGIN/lib' "${OUT}/$f" + zip -j -r "${OUT}/${f}_seed_corpus.zip" $ORIG_DIR/fuzzing_corpus/ done mkdir -p "${OUT}/lib"