bin_PROGRAMS += fuzz_applayerprotodetectgetproto \
fuzz_applayerparserparse fuzz_siginit \
fuzz_confyamlloadstring fuzz_decodepcapfile \
- fuzz_sigpcap fuzz_mimedecparseline fuzz_decodeder
+ fuzz_sigpcap fuzz_mimedecparseline
endif
COMMON_SOURCES = \
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(fuzz_mimedecparseline_LDFLAGS) $(LDFLAGS) -o $@
-nodist_fuzz_decodeder_SOURCES = tests/fuzz/fuzz_decodeder.c $(COMMON_SOURCES)
-fuzz_decodeder_LDFLAGS = $(all_libraries) ${SECLDFLAGS}
-fuzz_decodeder_LDADD = $(RUST_SURICATA_LIB) $(HTP_LDADD) $(RUST_LDADD)
-if HAS_FUZZLDFLAGS
- fuzz_decodeder_LDFLAGS += $(LIB_FUZZING_ENGINE)
-else
- nodist_fuzz_decodeder_SOURCES += tests/fuzz/onefile.c
-endif
-# force usage of CXX for linker
-fuzz_decodeder_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
- $(fuzz_decodeder_LDFLAGS) $(LDFLAGS) -o $@
-
# default CFLAGS
AM_CFLAGS = ${OPTIMIZATION_CFLAGS} ${GCC_CFLAGS} ${CLANG_CFLAGS} \
${SECCFLAGS} ${PCAP_CFLAGS} -DLOCAL_STATE_DIR=\"$(localstatedir)\" \
+++ /dev/null
-/**
- * @file
- * @author Philippe Antoine <contact@catenacyber.fr>
- * fuzz target for DecodeDer
- */
-
-
-#include "suricata-common.h"
-#include "util-decode-der.h"
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-static int initialized = 0;
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
-{
- if (initialized == 0) {
- //Redirects logs to /dev/null
- setenv("SC_LOG_OP_IFACE", "file", 0);
- setenv("SC_LOG_FILE", "/dev/null", 0);
- //global init
- InitGlobal();
- run_mode = RUNMODE_UNITTEST;
- initialized = 1;
- }
- uint32_t errcode = 0;
-
- Asn1Generic *a = DecodeDer(data, size, &errcode);
- DerFree(a);
-
- return 0;
-}