ikev2: Only send one certificate request for the same CA
[strongswan.git] / fuzz / Makefile.am
index 6d3d83f..3962896 100644 (file)
@@ -8,7 +8,7 @@ fuzz_ldflags = ${libfuzzer} \
        -Wl,-Bstatic -lgmp -Wl,-Bdynamic \
        @FUZZING_LDFLAGS@
 
        -Wl,-Bstatic -lgmp -Wl,-Bdynamic \
        @FUZZING_LDFLAGS@
 
-FUZZ_TARGETS=fuzz_certs
+FUZZ_TARGETS=fuzz_certs fuzz_crls
 
 all-local: $(FUZZ_TARGETS)
 
 
 all-local: $(FUZZ_TARGETS)
 
@@ -17,6 +17,18 @@ CLEANFILES=$(FUZZ_TARGETS)
 fuzz_certs: fuzz_certs.c ${libfuzzer}
        $(CC) $(AM_CPPFLAGS) $(CFLAGS) -o $@ $< $(fuzz_ldflags)
 
 fuzz_certs: fuzz_certs.c ${libfuzzer}
        $(CC) $(AM_CPPFLAGS) $(CFLAGS) -o $@ $< $(fuzz_ldflags)
 
+fuzz_crls: fuzz_crls.c ${libfuzzer}
+       $(CC) $(AM_CPPFLAGS) $(CFLAGS) -o $@ $< $(fuzz_ldflags)
+
 noinst_LIBRARIES = libFuzzerLocal.a
 libFuzzerLocal_a_SOURCES = libFuzzerLocal.c
 libFuzzerLocal_a_LIBADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
 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}/*; \
+               crashes=$(FUZZING_CORPORA)/$${corpus}-crash; \
+               test ! -d $${crashes} || ./$$f $${crashes}/*; \
+       done