fuzzing: Run local fuzz targets on given corpora during `make check`
authorTobias Brunner <tobias@strongswan.org>
Tue, 30 May 2017 14:46:32 +0000 (16:46 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 15 Aug 2017 08:35:20 +0000 (10:35 +0200)
The base directory of the corpora must be set in FUZZING_CORPORA.

fuzz/Makefile.am

index 6d3d83f..927ace7 100644 (file)
@@ -20,3 +20,10 @@ fuzz_certs: fuzz_certs.c ${libfuzzer}
 noinst_LIBRARIES = libFuzzerLocal.a
 libFuzzerLocal_a_SOURCES = libFuzzerLocal.c
 libFuzzerLocal_a_LIBADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+
+check: all
+       for f in $(FUZZ_TARGETS); do \
+               corpus=$${f#fuzz_}; \
+               corpus=$${corpus%%_*}; \
+               ./$$f $(FUZZING_CORPORA)/$${corpus}/*; \
+       done