diff options
author | Arjun <pkillarjun@protonmail.com> | 2024-05-09 21:13:03 +0530 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2024-05-28 16:13:29 -0400 |
commit | c3dccd348e3c557cbc34b3be0cbc13aff1bfa144 (patch) | |
tree | d7d69c8cb27860ad01406ebf352d57cb9a458aa6 /src/tests/fuzzing/README | |
parent | 4b21b2e2821d3cb91042be09e0ebe09707a57d72 (diff) | |
download | krb5-c3dccd348e3c557cbc34b3be0cbc13aff1bfa144.zip krb5-c3dccd348e3c557cbc34b3be0cbc13aff1bfa144.tar.gz krb5-c3dccd348e3c557cbc34b3be0cbc13aff1bfa144.tar.bz2 |
Add OSS-Fuzz targets and corpora
[ghudson@mit.edu: style adjustments]
bigredbutton: whitespace
Diffstat (limited to 'src/tests/fuzzing/README')
-rw-r--r-- | src/tests/fuzzing/README | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tests/fuzzing/README b/src/tests/fuzzing/README new file mode 100644 index 0000000..d133824 --- /dev/null +++ b/src/tests/fuzzing/README @@ -0,0 +1,26 @@ +This directory builds fuzzing targets for oss-fuzz compatibility. + If you wish to build it locally, you can do so by using the given + guide below. Note that it only works on GNU/Linux. + +Export flags required for building fuzzing targets. +```bash +export CC=clang +export CXX=clang++ +export CFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link" +export CXXFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link" +export LIB_FUZZING_ENGINE="-fsanitize=fuzzer" +``` + +Compilation of the fuzzing targets. +```bash +autoreconf +./configure CFLAGS="-fcommon $CFLAGS" CXXFLAGS="-fcommon $CXXFLAGS" \ + --enable-static --disable-shared --enable-ossfuzz +make +``` + +Running fuzzing targets. +```bash +mkdir fuzz_${TARGET}_corpus +./fuzz_${TARGET} fuzz_${TARGET}_corpus/ fuzz_${TARGET}_seed_corpus +``` |