From: Philippe Antoine Date: Thu, 26 Mar 2020 13:42:50 +0000 (+0100) Subject: fuzz: remove decodeder fuzz target X-Git-Tag: suricata-6.0.0-beta1~593 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=440bb4d6007560be6e431fb2087d1d28c3676872;p=thirdparty%2Fsuricata.git fuzz: remove decodeder fuzz target As we removed decodeder function --- diff --git a/src/Makefile.am b/src/Makefile.am index 28cf620071..8036c0a9b7 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,7 +10,7 @@ if BUILD_FUZZTARGETS 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 = \ @@ -642,19 +642,6 @@ fuzz_mimedecparseline_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(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)\" \ diff --git a/src/tests/fuzz/fuzz_decodeder.c b/src/tests/fuzz/fuzz_decodeder.c deleted file mode 100644 index 7fc4fb70e9..0000000000 --- a/src/tests/fuzz/fuzz_decodeder.c +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file - * @author Philippe Antoine - * 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; -}