fuzz: pl7m: add a custom mutator for better fuzzing of pcap files (#2483)
Pl7m is a custom mutator (used for structure aware fuzzing) for network traffic packet captures (i.e. pcap files). The output of the mutator is always a valid pcap file, containing the same flows/sessions of the input file. That's it: the mutator only changes the packet payload after the TCP/UDP header, keeping all the original L2/L3 information (IP addresses and L4 ports). See: https://github.com/IvanNardi/pl7m
This commit is contained in:
+11
@@ -85,6 +85,11 @@
|
|||||||
/fuzz/fuzz_gcrypt_gcm
|
/fuzz/fuzz_gcrypt_gcm
|
||||||
/fuzz/fuzz_gcrypt_cipher
|
/fuzz/fuzz_gcrypt_cipher
|
||||||
/fuzz/fuzz_ndpi_reader_payload_analyzer
|
/fuzz/fuzz_ndpi_reader_payload_analyzer
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_simplest
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_simplest_internal
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_64k
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_internal
|
||||||
/fuzz/fuzz_filecfg_protocols
|
/fuzz/fuzz_filecfg_protocols
|
||||||
/fuzz/fuzz_filecfg_categories
|
/fuzz/fuzz_filecfg_categories
|
||||||
/fuzz/fuzz_filecfg_category
|
/fuzz/fuzz_filecfg_category
|
||||||
@@ -96,6 +101,11 @@
|
|||||||
/fuzz/fuzz_readerutils_parseprotolist
|
/fuzz/fuzz_readerutils_parseprotolist
|
||||||
/fuzz/fuzz_ndpi_reader_alloc_fail_seed_corpus.zip
|
/fuzz/fuzz_ndpi_reader_alloc_fail_seed_corpus.zip
|
||||||
/fuzz/fuzz_ndpi_reader_seed_corpus.zip
|
/fuzz/fuzz_ndpi_reader_seed_corpus.zip
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_seed_corpus.zip
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_64k_seed_corpus.zip
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_internal_seed_corpus.zip
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_simplest_seed_corpus.zip
|
||||||
|
/fuzz/fuzz_ndpi_reader_pl7m_simplest_internal_seed_corpus.zip
|
||||||
/fuzz/fuzz_quic_get_crypto_data_seed_corpus.zip
|
/fuzz/fuzz_quic_get_crypto_data_seed_corpus.zip
|
||||||
/fuzz/fuzz_community_id_seed_corpus.zip
|
/fuzz/fuzz_community_id_seed_corpus.zip
|
||||||
/fuzz/fuzz_is_stun_udp_seed_corpus.zip
|
/fuzz/fuzz_is_stun_udp_seed_corpus.zip
|
||||||
@@ -152,6 +162,7 @@
|
|||||||
/src/lib/libndpi.so*
|
/src/lib/libndpi.so*
|
||||||
/src/lib/protocols/.deps/
|
/src/lib/protocols/.deps/
|
||||||
/src/lib/third_party/src/.deps/
|
/src/lib/third_party/src/.deps/
|
||||||
|
/src/lib/third_party/src/fuzz/.deps/
|
||||||
/tags
|
/tags
|
||||||
/test-driver
|
/test-driver
|
||||||
/tests/Makefile
|
/tests/Makefile
|
||||||
|
|||||||
+83
-1
@@ -11,6 +11,8 @@ bin_PROGRAMS += fuzz_gcrypt_light fuzz_gcrypt_aes fuzz_gcrypt_gcm fuzz_gcrypt_ci
|
|||||||
bin_PROGRAMS += fuzz_filecfg_protocols fuzz_filecfg_categories fuzz_filecfg_malicious_sha1 fuzz_filecfg_malicious_ja3 fuzz_filecfg_risk_domains fuzz_filecfg_config fuzz_filecfg_category
|
bin_PROGRAMS += fuzz_filecfg_protocols fuzz_filecfg_categories fuzz_filecfg_malicious_sha1 fuzz_filecfg_malicious_ja3 fuzz_filecfg_risk_domains fuzz_filecfg_config fuzz_filecfg_category
|
||||||
#Reader utils
|
#Reader utils
|
||||||
bin_PROGRAMS += fuzz_readerutils_workflow fuzz_readerutils_parseprotolist
|
bin_PROGRAMS += fuzz_readerutils_workflow fuzz_readerutils_parseprotolist
|
||||||
|
#Mutators
|
||||||
|
bin_PROGRAMS += fuzz_ndpi_reader_pl7m fuzz_ndpi_reader_pl7m_64k fuzz_ndpi_reader_pl7m_simplest fuzz_ndpi_reader_pl7m_internal fuzz_ndpi_reader_pl7m_simplest_internal
|
||||||
|
|
||||||
fuzz_process_packet_SOURCES = fuzz_process_packet.c fuzz_common_code.c
|
fuzz_process_packet_SOURCES = fuzz_process_packet.c fuzz_common_code.c
|
||||||
fuzz_process_packet_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS)
|
fuzz_process_packet_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS)
|
||||||
@@ -632,6 +634,71 @@ fuzz_readerutils_parseprotolist_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOL
|
|||||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||||
$(fuzz_readerutils_parseprotolist_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
$(fuzz_readerutils_parseprotolist_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_SOURCES = fuzz_ndpi_reader.c fuzz_common_code.c ../example/reader_util.c ../src/lib/third_party/src/fuzz/pl7m.c
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_CFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS) -I../src/lib/third_party/include/ -DENABLE_PCAP_L7_MUTATOR -DPL7M_USE_SIMPLEST_MUTATOR
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_LDFLAGS = $(PCAP_LIB) $(LIBS)
|
||||||
|
if HAS_FUZZLDFLAGS
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
endif
|
||||||
|
# force usage of CXX for linker
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||||
|
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||||
|
$(fuzz_ndpi_reader_pl7m_simplest_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_internal_SOURCES = fuzz_ndpi_reader.c fuzz_common_code.c ../example/reader_util.c ../src/lib/third_party/src/fuzz/pl7m.c
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_internal_CFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS) -I../src/lib/third_party/include/ -DENABLE_PCAP_L7_MUTATOR -DPL7M_USE_SIMPLEST_MUTATOR -DPL7M_USE_INTERNAL_FUZZER_MUTATE
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_internal_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_internal_LDFLAGS = $(PCAP_LIB) $(LIBS)
|
||||||
|
if HAS_FUZZLDFLAGS
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_internal_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_internal_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
endif
|
||||||
|
# force usage of CXX for linker
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_internal_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||||
|
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||||
|
$(fuzz_ndpi_reader_pl7m_simplest_internal_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_SOURCES = fuzz_ndpi_reader.c fuzz_common_code.c ../example/reader_util.c ../src/lib/third_party/src/fuzz/pl7m.c
|
||||||
|
fuzz_ndpi_reader_pl7m_CFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS) -I../src/lib/third_party/include/ -DENABLE_PCAP_L7_MUTATOR
|
||||||
|
fuzz_ndpi_reader_pl7m_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||||
|
fuzz_ndpi_reader_pl7m_LDFLAGS = $(PCAP_LIB) $(LIBS)
|
||||||
|
if HAS_FUZZLDFLAGS
|
||||||
|
fuzz_ndpi_reader_pl7m_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
fuzz_ndpi_reader_pl7m_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
endif
|
||||||
|
# force usage of CXX for linker
|
||||||
|
fuzz_ndpi_reader_pl7m_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||||
|
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||||
|
$(fuzz_ndpi_reader_pl7m_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_64k_SOURCES = fuzz_ndpi_reader.c fuzz_common_code.c ../example/reader_util.c ../src/lib/third_party/src/fuzz/pl7m.c
|
||||||
|
fuzz_ndpi_reader_pl7m_64k_CFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS) -I../src/lib/third_party/include/ -DENABLE_PCAP_L7_MUTATOR -DPL7M_USE_64K_PACKETS
|
||||||
|
fuzz_ndpi_reader_pl7m_64k_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||||
|
fuzz_ndpi_reader_pl7m_64k_LDFLAGS = $(PCAP_LIB) $(LIBS)
|
||||||
|
if HAS_FUZZLDFLAGS
|
||||||
|
fuzz_ndpi_reader_pl7m_64k_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
fuzz_ndpi_reader_pl7m_64k_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
endif
|
||||||
|
# force usage of CXX for linker
|
||||||
|
fuzz_ndpi_reader_pl7m_64k_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||||
|
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||||
|
$(fuzz_ndpi_reader_pl7m_64k_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_internal_SOURCES = fuzz_ndpi_reader.c fuzz_common_code.c ../example/reader_util.c ../src/lib/third_party/src/fuzz/pl7m.c
|
||||||
|
fuzz_ndpi_reader_pl7m_internal_CFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS) -I../src/lib/third_party/include/ -DENABLE_PCAP_L7_MUTATOR -DPL7M_USE_INTERNAL_FUZZER_MUTATE
|
||||||
|
fuzz_ndpi_reader_pl7m_internal_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||||
|
fuzz_ndpi_reader_pl7m_internal_LDFLAGS = $(PCAP_LIB) $(LIBS)
|
||||||
|
if HAS_FUZZLDFLAGS
|
||||||
|
fuzz_ndpi_reader_pl7m_internal_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
fuzz_ndpi_reader_pl7m_internal_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
endif
|
||||||
|
# force usage of CXX for linker
|
||||||
|
fuzz_ndpi_reader_pl7m_internal_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||||
|
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||||
|
$(fuzz_ndpi_reader_pl7m_internal_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
|
||||||
# required for Google oss-fuzz
|
# required for Google oss-fuzz
|
||||||
# see https://github.com/google/oss-fuzz/tree/master/projects/ndpi
|
# see https://github.com/google/oss-fuzz/tree/master/projects/ndpi
|
||||||
@@ -649,6 +716,21 @@ fuzz_ndpi_reader_alloc_fail_seed_corpus.zip: testpcaps.zip
|
|||||||
fuzz_ndpi_reader_payload_analyzer_seed_corpus.zip: testpcaps.zip
|
fuzz_ndpi_reader_payload_analyzer_seed_corpus.zip: testpcaps.zip
|
||||||
cp testpcaps.zip fuzz_ndpi_reader_payload_analyzer_seed_corpus.zip
|
cp testpcaps.zip fuzz_ndpi_reader_payload_analyzer_seed_corpus.zip
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_seed_corpus.zip: testpcaps.zip
|
||||||
|
cp testpcaps.zip fuzz_ndpi_reader_pl7m_simplest_seed_corpus.zip
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_simplest_internal_seed_corpus.zip: testpcaps.zip
|
||||||
|
cp testpcaps.zip fuzz_ndpi_reader_pl7m_simplest_internal_seed_corpus.zip
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_seed_corpus.zip: testpcaps.zip
|
||||||
|
cp testpcaps.zip fuzz_ndpi_reader_pl7m_seed_corpus.zip
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_64k_seed_corpus.zip: testpcaps.zip
|
||||||
|
cp testpcaps.zip fuzz_ndpi_reader_pl7m_64k_seed_corpus.zip
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_pl7m_internal_seed_corpus.zip: testpcaps.zip
|
||||||
|
cp testpcaps.zip fuzz_ndpi_reader_pl7m_internal_seed_corpus.zip
|
||||||
|
|
||||||
files_corpus_fuzz_quic_get_crypto_data := $(wildcard corpus/fuzz_quic_get_crypto_data/*)
|
files_corpus_fuzz_quic_get_crypto_data := $(wildcard corpus/fuzz_quic_get_crypto_data/*)
|
||||||
fuzz_quic_get_crypto_data_seed_corpus.zip: $(files_corpus_fuzz_quic_get_crypto_data)
|
fuzz_quic_get_crypto_data_seed_corpus.zip: $(files_corpus_fuzz_quic_get_crypto_data)
|
||||||
zip -j fuzz_quic_get_crypto_data_seed_corpus.zip $(files_corpus_fuzz_quic_get_crypto_data)
|
zip -j fuzz_quic_get_crypto_data_seed_corpus.zip $(files_corpus_fuzz_quic_get_crypto_data)
|
||||||
@@ -753,7 +835,7 @@ files_corpus_fuzz_ds_domain_classify := $(wildcard corpus/fuzz_ds_domain_classi
|
|||||||
fuzz_ds_domain_classify_seed_corpus.zip: $(files_corpus_fuzz_ds_domain_classify)
|
fuzz_ds_domain_classify_seed_corpus.zip: $(files_corpus_fuzz_ds_domain_classify)
|
||||||
zip -j fuzz_ds_domain_classify_seed_corpus.zip $(files_corpus_fuzz_ds_domain_classify)
|
zip -j fuzz_ds_domain_classify_seed_corpus.zip $(files_corpus_fuzz_ds_domain_classify)
|
||||||
|
|
||||||
corpus: fuzz_ndpi_reader_seed_corpus.zip fuzz_ndpi_reader_alloc_fail_seed_corpus.zip fuzz_ndpi_reader_payload_analyzer_seed_corpus.zip fuzz_quic_get_crypto_data_seed_corpus.zip fuzz_alg_ses_des_seed_corpus.zip fuzz_alg_bins_seed_corpus.zip fuzz_alg_hll_seed_corpus.zip fuzz_alg_jitter_seed_corpus.zip fuzz_ds_libcache_seed_corpus.zip fuzz_community_id_seed_corpus.zip fuzz_serialization_seed_corpus.zip fuzz_ds_ptree_seed_corpus.zip fuzz_alg_crc32_md5_seed_corpus.zip fuzz_alg_bytestream_seed_corpus.zip fuzz_libinjection_seed_corpus.zip fuzz_tls_certificate_seed_corpus.zip fuzz_filecfg_protocols_seed_corpus.zip fuzz_readerutils_workflow_seed_corpus.zip fuzz_readerutils_parseprotolist_seed_corpus.zip fuzz_ds_bitmap64_fuse_seed_corpus.zip fuzz_ds_domain_classify_seed_corpus.zip fuzz_filecfg_protocols_seed_corpus.zip fuzz_filecfg_categories_seed_corpus.zip fuzz_filecfg_config_seed_corpus.zip fuzz_filecfg_category_seed_corpus.zip fuzz_is_stun_udp_seed_corpus.zip fuzz_is_stun_tcp_seed_corpus.zip fuzz_filecfg_malicious_sha1_seed_corpus.zip fuzz_filecfg_malicious_ja3_seed_corpus.zip fuzz_filecfg_risk_domains_seed_corpus.zip
|
corpus: fuzz_ndpi_reader_seed_corpus.zip fuzz_ndpi_reader_alloc_fail_seed_corpus.zip fuzz_ndpi_reader_payload_analyzer_seed_corpus.zip fuzz_quic_get_crypto_data_seed_corpus.zip fuzz_alg_ses_des_seed_corpus.zip fuzz_alg_bins_seed_corpus.zip fuzz_alg_hll_seed_corpus.zip fuzz_alg_jitter_seed_corpus.zip fuzz_ds_libcache_seed_corpus.zip fuzz_community_id_seed_corpus.zip fuzz_serialization_seed_corpus.zip fuzz_ds_ptree_seed_corpus.zip fuzz_alg_crc32_md5_seed_corpus.zip fuzz_alg_bytestream_seed_corpus.zip fuzz_libinjection_seed_corpus.zip fuzz_tls_certificate_seed_corpus.zip fuzz_filecfg_protocols_seed_corpus.zip fuzz_readerutils_workflow_seed_corpus.zip fuzz_readerutils_parseprotolist_seed_corpus.zip fuzz_ds_bitmap64_fuse_seed_corpus.zip fuzz_ds_domain_classify_seed_corpus.zip fuzz_filecfg_protocols_seed_corpus.zip fuzz_is_stun_udp_seed_corpus.zip fuzz_is_stun_tcp_seed_corpus.zip fuzz_ndpi_reader_pl7m_simplest_seed_corpus.zip fuzz_ndpi_reader_pl7m_seed_corpus.zip fuzz_ndpi_reader_pl7m_64k_seed_corpus.zip fuzz_ndpi_reader_pl7m_simplest_internal_seed_corpus.zip fuzz_ndpi_reader_pl7m_internal_seed_corpus.zip
|
||||||
cp corpus/fuzz_*seed_corpus.zip .
|
cp corpus/fuzz_*seed_corpus.zip .
|
||||||
|
|
||||||
#Create dictionaries exactly as expected by oss-fuzz.
|
#Create dictionaries exactly as expected by oss-fuzz.
|
||||||
|
|||||||
@@ -8,6 +8,10 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifdef ENABLE_PCAP_L7_MUTATOR
|
||||||
|
#include "pl7m.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ndpi_workflow_prefs *prefs = NULL;
|
struct ndpi_workflow_prefs *prefs = NULL;
|
||||||
struct ndpi_workflow *workflow = NULL;
|
struct ndpi_workflow *workflow = NULL;
|
||||||
struct ndpi_global_context *g_ctx;
|
struct ndpi_global_context *g_ctx;
|
||||||
@@ -24,6 +28,13 @@ extern void ndpi_report_payload_stats(FILE *out);
|
|||||||
extern int force_no_aesni;
|
extern int force_no_aesni;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_PCAP_L7_MUTATOR
|
||||||
|
size_t LLVMFuzzerCustomMutator(uint8_t *Data, size_t Size,
|
||||||
|
size_t MaxSize, unsigned int Seed) {
|
||||||
|
return pl7m_mutator(Data, Size, MaxSize, Seed);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||||
pcap_t * pkts;
|
pcap_t * pkts;
|
||||||
const u_char *pkt;
|
const u_char *pkt;
|
||||||
|
|||||||
Vendored
+49
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023-24 Ivan Nardi <nardi.ivan@gmail.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __PCAP_L7_MUTATOR__
|
||||||
|
#define __PCAP_L7_MUTATOR__
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
size_t pl7m_mutator(uint8_t *data, size_t size, size_t max_size,
|
||||||
|
unsigned int seed);
|
||||||
|
|
||||||
|
/* Useful (only?) for tests */
|
||||||
|
size_t pl7m_mutator_fd(FILE *fd_in, FILE *fd_out, size_t max_size,
|
||||||
|
unsigned int seed);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
Vendored
+1328
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user