Improve OpenSC fuzzing (#3683)

* opensc: Disable optimization to simplify debugging

* opensc: Include initial corpus
This commit is contained in:
Jakub Jelen 2020-05-07 14:08:03 +02:00 committed by GitHub
parent af766f3f2c
commit 5dbaaea032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -17,12 +17,15 @@
./bootstrap
# FIXME FUZZING_LIBS="$LIB_FUZZING_ENGINE" fails with some missing C++ library, I don't know how to fix this
./configure --disable-shared --disable-pcsc --enable-ctapi --enable-fuzzing FUZZING_LIBS="$LIB_FUZZING_ENGINE"
./configure --disable-optimization --disable-shared --disable-pcsc --enable-ctapi --enable-fuzzing FUZZING_LIBS="$LIB_FUZZING_ENGINE"
make -j4
cp src/tests/fuzzing/fuzz_asn1_print $OUT
cp src/tests/fuzzing/fuzz_asn1_sig_value $OUT
cp src/tests/fuzzing/fuzz_pkcs15_decode $OUT
cp src/tests/fuzzing/fuzz_pkcs15_reader $OUT
fuzzerFiles=$(find $SRC/opensc/src/tests/fuzzing/ -name "fuzz_*.c")
#cp src/tests/fuzzing/fuzz_pkcs15_reader.options $OUT
for F in $fuzzerFiles; do
fuzzerName=$(basename $F .c)
cp "$SRC/opensc/src/tests/fuzzing/$fuzzerName" $OUT
if [ -d "$SRC/opensc/src/tests/fuzzing/corpus/${fuzzerName}" ]; then
zip -j $OUT/${fuzzerName}_seed_corpus.zip $SRC/opensc/src/tests/fuzzing/corpus/${fuzzerName}/*
fi
done