diff options
81 files changed, 66 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore index c03fd9d3c..17b2a63d9 100644 --- a/.gitignore +++ b/.gitignore @@ -107,7 +107,6 @@ /fuzz/fuzz_alg_crc32_md5_seed_corpus.zip /fuzz/fuzz_alg_bytestream_seed_corpus.zip /fuzz/fuzz_ds_libcache_seed_corpus.zip -/fuzz/fuzz_ds_tree_seed_corpus.zip /fuzz/fuzz_ds_ptree_seed_corpus.zip /fuzz/fuzz_ds_bitmap64_seed_corpus.zip /fuzz/fuzz_ds_domain_classify_seed_corpus.zip diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am index 162e02864..34180a50f 100644 --- a/fuzz/Makefile.am +++ b/fuzz/Makefile.am @@ -183,7 +183,7 @@ fuzz_alg_jitter_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(fuzz_alg_jitter_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@ fuzz_alg_crc32_md5_SOURCES = fuzz_alg_crc32_md5.c -fuzz_alg_crc32_md5_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) +fuzz_alg_crc32_md5_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -I ../src/lib/third_party/include/ fuzz_alg_crc32_md5_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS) fuzz_alg_crc32_md5_LDFLAGS = $(LIBS) if HAS_FUZZLDFLAGS @@ -677,10 +677,6 @@ files_corpus_fuzz_ds_libcache := $(wildcard corpus/fuzz_ds_libcache/*) fuzz_ds_libcache_seed_corpus.zip: $(files_corpus_fuzz_ds_libcache) zip -j fuzz_ds_libcache_seed_corpus.zip $(files_corpus_fuzz_ds_libcache) -files_corpus_fuzz_ds_tree := $(wildcard corpus/fuzz_ds_tree/*) -fuzz_ds_tree_seed_corpus.zip: $(files_corpus_fuzz_ds_tree) - zip -j fuzz_ds_tree_seed_corpus.zip $(files_corpus_fuzz_ds_tree) - files_corpus_fuzz_ds_ptree := $(wildcard corpus/fuzz_ds_ptree/*) fuzz_ds_ptree_seed_corpus.zip: $(files_corpus_fuzz_ds_ptree) zip -j fuzz_ds_ptree_seed_corpus.zip $(files_corpus_fuzz_ds_ptree) @@ -741,7 +737,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) 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_ds_tree_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_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_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 cp corpus/fuzz_*seed_corpus.zip . #Create dictionaries exactly as expected by oss-fuzz. @@ -791,7 +787,6 @@ distdir: -o -path './corpus/fuzz_alg_crc32_md5/*' \ -o -path './corpus/fuzz_alg_bytestream/*' \ -o -path './corpus/fuzz_ds_libcache/*' \ - -o -path './corpus/fuzz_ds_tree/*' \ -o -path './corpus/fuzz_ds_bitmap64/*' \ -o -path './corpus/fuzz_ds_domain_classify/*' \ -o -path './corpus/fuzz_ds_ptree/*' | xargs -I'{}' cp -r '{}' '$(distdir)/{}' diff --git a/fuzz/corpus/fuzz_ds_tree/05b662515f000d83deb96ffc4583991d649cd5aa b/fuzz/corpus/fuzz_ds_tree/05b662515f000d83deb96ffc4583991d649cd5aa Binary files differdeleted file mode 100644 index 1a766f4ba..000000000 --- a/fuzz/corpus/fuzz_ds_tree/05b662515f000d83deb96ffc4583991d649cd5aa +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/05deb1919325611cef82cdbb9a9cae2e079a35e7 b/fuzz/corpus/fuzz_ds_tree/05deb1919325611cef82cdbb9a9cae2e079a35e7 Binary files differdeleted file mode 100644 index 614aa5a67..000000000 --- a/fuzz/corpus/fuzz_ds_tree/05deb1919325611cef82cdbb9a9cae2e079a35e7 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/0696e1fef974d3020398c0645c7f5dd946898729 b/fuzz/corpus/fuzz_ds_tree/0696e1fef974d3020398c0645c7f5dd946898729 Binary files differdeleted file mode 100644 index 73ebd2a4d..000000000 --- a/fuzz/corpus/fuzz_ds_tree/0696e1fef974d3020398c0645c7f5dd946898729 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/111657ab9fedcc5017d6df1970230b5dddd2d981 b/fuzz/corpus/fuzz_ds_tree/111657ab9fedcc5017d6df1970230b5dddd2d981 Binary files differdeleted file mode 100644 index 84f5a41da..000000000 --- a/fuzz/corpus/fuzz_ds_tree/111657ab9fedcc5017d6df1970230b5dddd2d981 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/17557d4ba17829b390c3de69535bf6ccfa2d5642 b/fuzz/corpus/fuzz_ds_tree/17557d4ba17829b390c3de69535bf6ccfa2d5642 Binary files differdeleted file mode 100644 index 450bb37fd..000000000 --- a/fuzz/corpus/fuzz_ds_tree/17557d4ba17829b390c3de69535bf6ccfa2d5642 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/239ec011fcc8cc26627acc3714c8faf52c5e0903 b/fuzz/corpus/fuzz_ds_tree/239ec011fcc8cc26627acc3714c8faf52c5e0903 Binary files differdeleted file mode 100644 index 7b5cf5b75..000000000 --- a/fuzz/corpus/fuzz_ds_tree/239ec011fcc8cc26627acc3714c8faf52c5e0903 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/241b26ca01fa5bbb08b23913607309f5063017bd b/fuzz/corpus/fuzz_ds_tree/241b26ca01fa5bbb08b23913607309f5063017bd Binary files differdeleted file mode 100644 index e3755a3e9..000000000 --- a/fuzz/corpus/fuzz_ds_tree/241b26ca01fa5bbb08b23913607309f5063017bd +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/24cf5c21b413b0e45721eb80edc898cf6e5f95dd b/fuzz/corpus/fuzz_ds_tree/24cf5c21b413b0e45721eb80edc898cf6e5f95dd Binary files differdeleted file mode 100644 index ad5333604..000000000 --- a/fuzz/corpus/fuzz_ds_tree/24cf5c21b413b0e45721eb80edc898cf6e5f95dd +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/274042194cc72a3f82a114918e3abdb5bd658add b/fuzz/corpus/fuzz_ds_tree/274042194cc72a3f82a114918e3abdb5bd658add Binary files differdeleted file mode 100644 index 3c9fee3da..000000000 --- a/fuzz/corpus/fuzz_ds_tree/274042194cc72a3f82a114918e3abdb5bd658add +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/2cf61acbd07ae5eae2549cedfbe05bf42bd595f7 b/fuzz/corpus/fuzz_ds_tree/2cf61acbd07ae5eae2549cedfbe05bf42bd595f7 Binary files differdeleted file mode 100644 index 35662cb4f..000000000 --- a/fuzz/corpus/fuzz_ds_tree/2cf61acbd07ae5eae2549cedfbe05bf42bd595f7 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/32c0c554c558ebedb342d3e70e1f023387d578c9 b/fuzz/corpus/fuzz_ds_tree/32c0c554c558ebedb342d3e70e1f023387d578c9 Binary files differdeleted file mode 100644 index 8a848b1cc..000000000 --- a/fuzz/corpus/fuzz_ds_tree/32c0c554c558ebedb342d3e70e1f023387d578c9 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/370f2d854e17f91097c19f2f4a1f8aa66a598105 b/fuzz/corpus/fuzz_ds_tree/370f2d854e17f91097c19f2f4a1f8aa66a598105 Binary files differdeleted file mode 100644 index 314d51079..000000000 --- a/fuzz/corpus/fuzz_ds_tree/370f2d854e17f91097c19f2f4a1f8aa66a598105 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/3fe5295ad34640228ce7dec8a120488f0b5df5ce b/fuzz/corpus/fuzz_ds_tree/3fe5295ad34640228ce7dec8a120488f0b5df5ce Binary files differdeleted file mode 100644 index eadbbde72..000000000 --- a/fuzz/corpus/fuzz_ds_tree/3fe5295ad34640228ce7dec8a120488f0b5df5ce +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/435d25dd83ae22d85ac4b2b4b100fca324c65e3d b/fuzz/corpus/fuzz_ds_tree/435d25dd83ae22d85ac4b2b4b100fca324c65e3d Binary files differdeleted file mode 100644 index 939c99222..000000000 --- a/fuzz/corpus/fuzz_ds_tree/435d25dd83ae22d85ac4b2b4b100fca324c65e3d +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/4977a67459382d8300d75b71b54b4ce1f40f4f09 b/fuzz/corpus/fuzz_ds_tree/4977a67459382d8300d75b71b54b4ce1f40f4f09 Binary files differdeleted file mode 100644 index 7b1c1b0c4..000000000 --- a/fuzz/corpus/fuzz_ds_tree/4977a67459382d8300d75b71b54b4ce1f40f4f09 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/4ae33f6357a1804090501f11e27d58461df9253c b/fuzz/corpus/fuzz_ds_tree/4ae33f6357a1804090501f11e27d58461df9253c Binary files differdeleted file mode 100644 index 03190c90a..000000000 --- a/fuzz/corpus/fuzz_ds_tree/4ae33f6357a1804090501f11e27d58461df9253c +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/4b77c547b98ceecc57e134d52f4692a1720e3ee1 b/fuzz/corpus/fuzz_ds_tree/4b77c547b98ceecc57e134d52f4692a1720e3ee1 Binary files differdeleted file mode 100644 index 6ee6cd7e5..000000000 --- a/fuzz/corpus/fuzz_ds_tree/4b77c547b98ceecc57e134d52f4692a1720e3ee1 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/4f62be7d61b679a0d916b2059854de5b9cb38dea b/fuzz/corpus/fuzz_ds_tree/4f62be7d61b679a0d916b2059854de5b9cb38dea Binary files differdeleted file mode 100644 index d0286227c..000000000 --- a/fuzz/corpus/fuzz_ds_tree/4f62be7d61b679a0d916b2059854de5b9cb38dea +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/51b2a0ef859f67c0dca37efea91b2a2e4ddc520c b/fuzz/corpus/fuzz_ds_tree/51b2a0ef859f67c0dca37efea91b2a2e4ddc520c Binary files differdeleted file mode 100644 index baaec0b68..000000000 --- a/fuzz/corpus/fuzz_ds_tree/51b2a0ef859f67c0dca37efea91b2a2e4ddc520c +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/53458e81c4f84d7b35213d40fd1a8b1cb1abc812 b/fuzz/corpus/fuzz_ds_tree/53458e81c4f84d7b35213d40fd1a8b1cb1abc812 Binary files differdeleted file mode 100644 index 94f85bbe2..000000000 --- a/fuzz/corpus/fuzz_ds_tree/53458e81c4f84d7b35213d40fd1a8b1cb1abc812 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/583d48c2482fd1679a98c1748b31d07a87f06b55 b/fuzz/corpus/fuzz_ds_tree/583d48c2482fd1679a98c1748b31d07a87f06b55 Binary files differdeleted file mode 100644 index 7b78eadd3..000000000 --- a/fuzz/corpus/fuzz_ds_tree/583d48c2482fd1679a98c1748b31d07a87f06b55 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/5da0471be3750ec4c44275e10344d7498c753312 b/fuzz/corpus/fuzz_ds_tree/5da0471be3750ec4c44275e10344d7498c753312 Binary files differdeleted file mode 100644 index c4a67fd71..000000000 --- a/fuzz/corpus/fuzz_ds_tree/5da0471be3750ec4c44275e10344d7498c753312 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/602f5edc05570fddabd77bccfb5c73d7cee95250 b/fuzz/corpus/fuzz_ds_tree/602f5edc05570fddabd77bccfb5c73d7cee95250 Binary files differdeleted file mode 100644 index 9e82458b5..000000000 --- a/fuzz/corpus/fuzz_ds_tree/602f5edc05570fddabd77bccfb5c73d7cee95250 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/6f52f1152b96f39858decee18afa95914a754344 b/fuzz/corpus/fuzz_ds_tree/6f52f1152b96f39858decee18afa95914a754344 Binary files differdeleted file mode 100644 index 484cd28fd..000000000 --- a/fuzz/corpus/fuzz_ds_tree/6f52f1152b96f39858decee18afa95914a754344 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/75a68982c7fd83542649a050e52298381666bcc8 b/fuzz/corpus/fuzz_ds_tree/75a68982c7fd83542649a050e52298381666bcc8 Binary files differdeleted file mode 100644 index 1062d1250..000000000 --- a/fuzz/corpus/fuzz_ds_tree/75a68982c7fd83542649a050e52298381666bcc8 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/839ae313f042b2b2dd388634a5362c08f755f030 b/fuzz/corpus/fuzz_ds_tree/839ae313f042b2b2dd388634a5362c08f755f030 Binary files differdeleted file mode 100644 index 6cf2ccca4..000000000 --- a/fuzz/corpus/fuzz_ds_tree/839ae313f042b2b2dd388634a5362c08f755f030 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/83df4b8639a2acdee98fb7a71bbc089316687b77 b/fuzz/corpus/fuzz_ds_tree/83df4b8639a2acdee98fb7a71bbc089316687b77 Binary files differdeleted file mode 100644 index 8381f94e8..000000000 --- a/fuzz/corpus/fuzz_ds_tree/83df4b8639a2acdee98fb7a71bbc089316687b77 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/867d3eef3c25cacaff5080853ba1f8ddad3e3cbf b/fuzz/corpus/fuzz_ds_tree/867d3eef3c25cacaff5080853ba1f8ddad3e3cbf Binary files differdeleted file mode 100644 index 26e1705bf..000000000 --- a/fuzz/corpus/fuzz_ds_tree/867d3eef3c25cacaff5080853ba1f8ddad3e3cbf +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/90cf625aeb7846a5e9d860a9e920afb3e8657899 b/fuzz/corpus/fuzz_ds_tree/90cf625aeb7846a5e9d860a9e920afb3e8657899 Binary files differdeleted file mode 100644 index 260adb925..000000000 --- a/fuzz/corpus/fuzz_ds_tree/90cf625aeb7846a5e9d860a9e920afb3e8657899 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/90e013b209b0881e82bce7501cbf06928c6639c7 b/fuzz/corpus/fuzz_ds_tree/90e013b209b0881e82bce7501cbf06928c6639c7 Binary files differdeleted file mode 100644 index 9d6aabc9b..000000000 --- a/fuzz/corpus/fuzz_ds_tree/90e013b209b0881e82bce7501cbf06928c6639c7 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/9435e886552b98fa38c2e89e07392d8048d6649f b/fuzz/corpus/fuzz_ds_tree/9435e886552b98fa38c2e89e07392d8048d6649f Binary files differdeleted file mode 100644 index 0c59f763a..000000000 --- a/fuzz/corpus/fuzz_ds_tree/9435e886552b98fa38c2e89e07392d8048d6649f +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/963a99817279211d121c533b803a64de91c85af0 b/fuzz/corpus/fuzz_ds_tree/963a99817279211d121c533b803a64de91c85af0 Binary files differdeleted file mode 100644 index 59a20b9a2..000000000 --- a/fuzz/corpus/fuzz_ds_tree/963a99817279211d121c533b803a64de91c85af0 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/99e376668c01c6a56bd1689e5d8664587c4fee28 b/fuzz/corpus/fuzz_ds_tree/99e376668c01c6a56bd1689e5d8664587c4fee28 Binary files differdeleted file mode 100644 index 222b2d384..000000000 --- a/fuzz/corpus/fuzz_ds_tree/99e376668c01c6a56bd1689e5d8664587c4fee28 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/9c8e942b24add8ad2e15186bc5de91464c8b3a1b b/fuzz/corpus/fuzz_ds_tree/9c8e942b24add8ad2e15186bc5de91464c8b3a1b Binary files differdeleted file mode 100644 index 0adbd0b76..000000000 --- a/fuzz/corpus/fuzz_ds_tree/9c8e942b24add8ad2e15186bc5de91464c8b3a1b +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/a5d92fddf545081b06db2a55c860d89087c3ce65 b/fuzz/corpus/fuzz_ds_tree/a5d92fddf545081b06db2a55c860d89087c3ce65 Binary files differdeleted file mode 100644 index 9b9ccef28..000000000 --- a/fuzz/corpus/fuzz_ds_tree/a5d92fddf545081b06db2a55c860d89087c3ce65 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/a80d8aae221736aa612f8a82b202f5fce0eb9500 b/fuzz/corpus/fuzz_ds_tree/a80d8aae221736aa612f8a82b202f5fce0eb9500 Binary files differdeleted file mode 100644 index 0d98f2019..000000000 --- a/fuzz/corpus/fuzz_ds_tree/a80d8aae221736aa612f8a82b202f5fce0eb9500 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/aa5f590b2f8ae90f488320a5c0ce1664b6250141 b/fuzz/corpus/fuzz_ds_tree/aa5f590b2f8ae90f488320a5c0ce1664b6250141 Binary files differdeleted file mode 100644 index 7f5cb4d5f..000000000 --- a/fuzz/corpus/fuzz_ds_tree/aa5f590b2f8ae90f488320a5c0ce1664b6250141 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/adc80cc99b35d6e8df1f170f2a13c6bcd6d398a1 b/fuzz/corpus/fuzz_ds_tree/adc80cc99b35d6e8df1f170f2a13c6bcd6d398a1 Binary files differdeleted file mode 100644 index 5e0efb8f8..000000000 --- a/fuzz/corpus/fuzz_ds_tree/adc80cc99b35d6e8df1f170f2a13c6bcd6d398a1 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/ae84c8f1709ff8fcefae24ebc14ffbfeebca84a8 b/fuzz/corpus/fuzz_ds_tree/ae84c8f1709ff8fcefae24ebc14ffbfeebca84a8 Binary files differdeleted file mode 100644 index 6a2695883..000000000 --- a/fuzz/corpus/fuzz_ds_tree/ae84c8f1709ff8fcefae24ebc14ffbfeebca84a8 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/b410f65cc307e42ab5966239c11439da11c0ddb4 b/fuzz/corpus/fuzz_ds_tree/b410f65cc307e42ab5966239c11439da11c0ddb4 Binary files differdeleted file mode 100644 index 80d94efb7..000000000 --- a/fuzz/corpus/fuzz_ds_tree/b410f65cc307e42ab5966239c11439da11c0ddb4 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/b6326b0500fa509026c488db8451367ad82a737d b/fuzz/corpus/fuzz_ds_tree/b6326b0500fa509026c488db8451367ad82a737d Binary files differdeleted file mode 100644 index d1bd11e7b..000000000 --- a/fuzz/corpus/fuzz_ds_tree/b6326b0500fa509026c488db8451367ad82a737d +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/b6db31b2248aeba214a6850c0702de7388ea1c24 b/fuzz/corpus/fuzz_ds_tree/b6db31b2248aeba214a6850c0702de7388ea1c24 Binary files differdeleted file mode 100644 index c9af8ec36..000000000 --- a/fuzz/corpus/fuzz_ds_tree/b6db31b2248aeba214a6850c0702de7388ea1c24 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/baee897444cc1c2da1ebc5669aaad8a0674bf5ec b/fuzz/corpus/fuzz_ds_tree/baee897444cc1c2da1ebc5669aaad8a0674bf5ec Binary files differdeleted file mode 100644 index b2181e7b2..000000000 --- a/fuzz/corpus/fuzz_ds_tree/baee897444cc1c2da1ebc5669aaad8a0674bf5ec +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/bb0687290c9a2fcc54a22495eebc3ffe8c62fcd4 b/fuzz/corpus/fuzz_ds_tree/bb0687290c9a2fcc54a22495eebc3ffe8c62fcd4 Binary files differdeleted file mode 100644 index 6beb58214..000000000 --- a/fuzz/corpus/fuzz_ds_tree/bb0687290c9a2fcc54a22495eebc3ffe8c62fcd4 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/bfa39a45c0fbd5ef61d95ec1481854884d6a1c83 b/fuzz/corpus/fuzz_ds_tree/bfa39a45c0fbd5ef61d95ec1481854884d6a1c83 Binary files differdeleted file mode 100644 index a91889215..000000000 --- a/fuzz/corpus/fuzz_ds_tree/bfa39a45c0fbd5ef61d95ec1481854884d6a1c83 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/c25d912a45389932e11154603810b3636bd076d3 b/fuzz/corpus/fuzz_ds_tree/c25d912a45389932e11154603810b3636bd076d3 Binary files differdeleted file mode 100644 index 1453014ca..000000000 --- a/fuzz/corpus/fuzz_ds_tree/c25d912a45389932e11154603810b3636bd076d3 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/c75804765207820234ad3053f61007ab0e4445b4 b/fuzz/corpus/fuzz_ds_tree/c75804765207820234ad3053f61007ab0e4445b4 Binary files differdeleted file mode 100644 index 6b1372107..000000000 --- a/fuzz/corpus/fuzz_ds_tree/c75804765207820234ad3053f61007ab0e4445b4 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/c825bf09aa976e7d4d67598407a3a4f8e83c6345 b/fuzz/corpus/fuzz_ds_tree/c825bf09aa976e7d4d67598407a3a4f8e83c6345 Binary files differdeleted file mode 100644 index e3ae559eb..000000000 --- a/fuzz/corpus/fuzz_ds_tree/c825bf09aa976e7d4d67598407a3a4f8e83c6345 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/c9b65a60fd06d4de01b8f5b83a893200073769e0 b/fuzz/corpus/fuzz_ds_tree/c9b65a60fd06d4de01b8f5b83a893200073769e0 Binary files differdeleted file mode 100644 index 65c7b290a..000000000 --- a/fuzz/corpus/fuzz_ds_tree/c9b65a60fd06d4de01b8f5b83a893200073769e0 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/cd7b984e87d4fce2d267888a3253c8aaad264af3 b/fuzz/corpus/fuzz_ds_tree/cd7b984e87d4fce2d267888a3253c8aaad264af3 Binary files differdeleted file mode 100644 index 38968e321..000000000 --- a/fuzz/corpus/fuzz_ds_tree/cd7b984e87d4fce2d267888a3253c8aaad264af3 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/ce005e480b643e822d3b99b2a21f6e6a6f448859 b/fuzz/corpus/fuzz_ds_tree/ce005e480b643e822d3b99b2a21f6e6a6f448859 Binary files differdeleted file mode 100644 index 38496e5b7..000000000 --- a/fuzz/corpus/fuzz_ds_tree/ce005e480b643e822d3b99b2a21f6e6a6f448859 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/cf29845e403bee085bda2d928f49673742592e17 b/fuzz/corpus/fuzz_ds_tree/cf29845e403bee085bda2d928f49673742592e17 Binary files differdeleted file mode 100644 index b0181498f..000000000 --- a/fuzz/corpus/fuzz_ds_tree/cf29845e403bee085bda2d928f49673742592e17 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/d1b8769985ac73bd8298231fb4a6e5ed5565cf9e b/fuzz/corpus/fuzz_ds_tree/d1b8769985ac73bd8298231fb4a6e5ed5565cf9e Binary files differdeleted file mode 100644 index 1cfe082b4..000000000 --- a/fuzz/corpus/fuzz_ds_tree/d1b8769985ac73bd8298231fb4a6e5ed5565cf9e +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/d4a8a0f375b984f26f41917103584c9917217043 b/fuzz/corpus/fuzz_ds_tree/d4a8a0f375b984f26f41917103584c9917217043 Binary files differdeleted file mode 100644 index a32850831..000000000 --- a/fuzz/corpus/fuzz_ds_tree/d4a8a0f375b984f26f41917103584c9917217043 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/d5b7e460b128cc07b7dbe2f845e8692370f9e2ef b/fuzz/corpus/fuzz_ds_tree/d5b7e460b128cc07b7dbe2f845e8692370f9e2ef Binary files differdeleted file mode 100644 index 9c2b44e2b..000000000 --- a/fuzz/corpus/fuzz_ds_tree/d5b7e460b128cc07b7dbe2f845e8692370f9e2ef +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/d821fc593a86796b420f93296017c7cb0175dd8d b/fuzz/corpus/fuzz_ds_tree/d821fc593a86796b420f93296017c7cb0175dd8d Binary files differdeleted file mode 100644 index f56a9364b..000000000 --- a/fuzz/corpus/fuzz_ds_tree/d821fc593a86796b420f93296017c7cb0175dd8d +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/dc720efbe4f824c52dd03cf9c06c71f9cd64e500 b/fuzz/corpus/fuzz_ds_tree/dc720efbe4f824c52dd03cf9c06c71f9cd64e500 Binary files differdeleted file mode 100644 index ea21b90bc..000000000 --- a/fuzz/corpus/fuzz_ds_tree/dc720efbe4f824c52dd03cf9c06c71f9cd64e500 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/e165cf4a81fe3d993948f049fb41a300c8286598 b/fuzz/corpus/fuzz_ds_tree/e165cf4a81fe3d993948f049fb41a300c8286598 Binary files differdeleted file mode 100644 index 148e69dcc..000000000 --- a/fuzz/corpus/fuzz_ds_tree/e165cf4a81fe3d993948f049fb41a300c8286598 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/e67f707ba8191170abba4703bb4f4192a0958939 b/fuzz/corpus/fuzz_ds_tree/e67f707ba8191170abba4703bb4f4192a0958939 Binary files differdeleted file mode 100644 index 12868aac5..000000000 --- a/fuzz/corpus/fuzz_ds_tree/e67f707ba8191170abba4703bb4f4192a0958939 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/e6e0376286b8df6332e56dc8757af060da95dd6a b/fuzz/corpus/fuzz_ds_tree/e6e0376286b8df6332e56dc8757af060da95dd6a Binary files differdeleted file mode 100644 index 13dcd9404..000000000 --- a/fuzz/corpus/fuzz_ds_tree/e6e0376286b8df6332e56dc8757af060da95dd6a +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/f0ba5409fa8e20e3220a2d12c9d9fe39cd2818d9 b/fuzz/corpus/fuzz_ds_tree/f0ba5409fa8e20e3220a2d12c9d9fe39cd2818d9 Binary files differdeleted file mode 100644 index bdef90f35..000000000 --- a/fuzz/corpus/fuzz_ds_tree/f0ba5409fa8e20e3220a2d12c9d9fe39cd2818d9 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/f18edcec12f7c8b5e1de7a43f3cb818677164e49 b/fuzz/corpus/fuzz_ds_tree/f18edcec12f7c8b5e1de7a43f3cb818677164e49 Binary files differdeleted file mode 100644 index 73737d8d5..000000000 --- a/fuzz/corpus/fuzz_ds_tree/f18edcec12f7c8b5e1de7a43f3cb818677164e49 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/f3259e536d2e75e24770e3afabf98a70a2e08932 b/fuzz/corpus/fuzz_ds_tree/f3259e536d2e75e24770e3afabf98a70a2e08932 Binary files differdeleted file mode 100644 index 200b24b81..000000000 --- a/fuzz/corpus/fuzz_ds_tree/f3259e536d2e75e24770e3afabf98a70a2e08932 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/f4318383dfd035c660f6454b98e0ee85846e6f9d b/fuzz/corpus/fuzz_ds_tree/f4318383dfd035c660f6454b98e0ee85846e6f9d Binary files differdeleted file mode 100644 index 9db6b5690..000000000 --- a/fuzz/corpus/fuzz_ds_tree/f4318383dfd035c660f6454b98e0ee85846e6f9d +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/f45ab2dcdc5e5b00f36ba223500dde998ae877f2 b/fuzz/corpus/fuzz_ds_tree/f45ab2dcdc5e5b00f36ba223500dde998ae877f2 Binary files differdeleted file mode 100644 index 49b36dfed..000000000 --- a/fuzz/corpus/fuzz_ds_tree/f45ab2dcdc5e5b00f36ba223500dde998ae877f2 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/f62df9a69adc6f49c64e2a993f7423b0d112f807 b/fuzz/corpus/fuzz_ds_tree/f62df9a69adc6f49c64e2a993f7423b0d112f807 Binary files differdeleted file mode 100644 index 97c9c316b..000000000 --- a/fuzz/corpus/fuzz_ds_tree/f62df9a69adc6f49c64e2a993f7423b0d112f807 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/f96090789e42f4fbfb8aea8038ef56137858ba61 b/fuzz/corpus/fuzz_ds_tree/f96090789e42f4fbfb8aea8038ef56137858ba61 Binary files differdeleted file mode 100644 index 2916dfd72..000000000 --- a/fuzz/corpus/fuzz_ds_tree/f96090789e42f4fbfb8aea8038ef56137858ba61 +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/fbe2f34ae81b42b92a275db2e23d6e7fbebb28fe b/fuzz/corpus/fuzz_ds_tree/fbe2f34ae81b42b92a275db2e23d6e7fbebb28fe Binary files differdeleted file mode 100644 index d9aa6ecce..000000000 --- a/fuzz/corpus/fuzz_ds_tree/fbe2f34ae81b42b92a275db2e23d6e7fbebb28fe +++ /dev/null diff --git a/fuzz/corpus/fuzz_ds_tree/fc82def89dce7a25407e29cb6553747e9dbefcb5 b/fuzz/corpus/fuzz_ds_tree/fc82def89dce7a25407e29cb6553747e9dbefcb5 Binary files differdeleted file mode 100644 index 9941e8379..000000000 --- a/fuzz/corpus/fuzz_ds_tree/fc82def89dce7a25407e29cb6553747e9dbefcb5 +++ /dev/null diff --git a/fuzz/fuzz_alg_crc32_md5.c b/fuzz/fuzz_alg_crc32_md5.c index 265bc0417..15c817989 100644 --- a/fuzz/fuzz_alg_crc32_md5.c +++ b/fuzz/fuzz_alg_crc32_md5.c @@ -1,7 +1,9 @@ #include "ndpi_api.h" +#include "ndpi_md5.h" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { u_char hash[16]; + ndpi_MD5_CTX ctx; struct ndpi_popcount popcount; char *str; @@ -14,8 +16,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ndpi_crc16_xmodem(data, size); ndpi_crc16_x25(data, size); ndpi_crc32(data, size); + ndpi_md5(data, size, hash); + ndpi_MD5Init(&ctx); + ndpi_MD5Update(&ctx, data, size / 2); + ndpi_MD5Update(&ctx, data + size / 2, size - size / 2); + ndpi_MD5Final(hash, &ctx); + ndpi_murmur_hash((const char *)data, size); ndpi_quick_hash(data, size); diff --git a/fuzz/fuzz_config.cpp b/fuzz/fuzz_config.cpp index daf2b561c..69fdbeeb6 100644 --- a/fuzz/fuzz_config.cpp +++ b/fuzz/fuzz_config.cpp @@ -12,7 +12,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { FuzzedDataProvider fuzzed_data(data, size); struct ndpi_detection_module_struct *ndpi_info_mod; struct ndpi_flow_struct flow; - u_int8_t protocol_was_guessed; + u_int8_t protocol_was_guessed, unused; u_int32_t i, ret; u_int16_t bool_value; NDPI_PROTOCOL_BITMASK enabled_bitmask; @@ -34,6 +34,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { char cfg_proto[32]; char cfg_param[32]; u_int64_t cat_userdata = 0; + u_int16_t unused1, unused2; /* To allow memory allocation failures */ fuzz_set_alloc_callbacks_and_seed(size); @@ -72,6 +73,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if(fuzzed_data.ConsumeBool()) ndpi_load_protocols_file(ndpi_info_mod, fuzzed_data.ConsumeBool() ? NULL : "invalid_filename"); /* Error */ if(fuzzed_data.ConsumeBool()) + ndpi_load_categories_dir(ndpi_info_mod, fuzzed_data.ConsumeBool() ? NULL : (char *)"./"); + if(fuzzed_data.ConsumeBool()) + ndpi_load_categories_dir(ndpi_info_mod, fuzzed_data.ConsumeBool() ? NULL : (char *)"invalid_dir"); + if(fuzzed_data.ConsumeBool()) ndpi_load_categories_file(ndpi_info_mod, "categories.txt", &cat_userdata); if(fuzzed_data.ConsumeBool()) ndpi_load_categories_file(ndpi_info_mod, fuzzed_data.ConsumeBool() ? NULL : "invalid_filename", &cat_userdata); /* Error */ @@ -484,6 +489,19 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ndpi_dump_risks_score(fuzzed_data.ConsumeBool() ? NULL : stdout); ndpi_dump_config(ndpi_info_mod, fuzzed_data.ConsumeBool() ? NULL : stdout); + char buf[8]; /* Too short in same cases... */ + if(fuzzed_data.ConsumeBool()) { + ndpi_ssl_version2str(buf, sizeof(buf), fuzzed_data.ConsumeIntegral<u_int16_t>(), &unused); + ndpi_get_ip_proto_name(fuzzed_data.ConsumeIntegral<u_int8_t>(), buf, sizeof(buf)); + } else { + ndpi_ssl_version2str(NULL, 0, fuzzed_data.ConsumeIntegral<u_int16_t>(), &unused); + ndpi_get_ip_proto_name(fuzzed_data.ConsumeIntegral<u_int8_t>(), NULL, 0); + } + ndpi_risk2str(static_cast<ndpi_risk_enum>(fuzzed_data.ConsumeIntegral<u_int64_t>())); + ndpi_severity2str(static_cast<ndpi_risk_severity>(fuzzed_data.ConsumeIntegral<u_int8_t>())); + ndpi_risk2score(static_cast<ndpi_risk_enum>(fuzzed_data.ConsumeIntegral<u_int64_t>()), &unused1, &unused2); + ndpi_http_method2str(static_cast<ndpi_http_method>(fuzzed_data.ConsumeIntegral<u_int8_t>())); + /* Basic code to try testing this "config" */ bool_value = fuzzed_data.ConsumeBool(); input_info.in_pkt_dir = fuzzed_data.ConsumeIntegralInRange(0,2); @@ -537,10 +555,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ndpi_search_tcp_or_udp(ndpi_info_mod, &flow); } if(!flow.is_ipv6) { - ndpi_network_ptree_match(ndpi_info_mod, (struct in_addr *)&flow.c_address.v4); + if(bool_value) + ndpi_network_risk_ptree_match(ndpi_info_mod, (struct in_addr *)&flow.c_address.v4); ndpi_risk_params params[] = { { NDPI_PARAM_HOSTNAME, flow.host_server_name}, - { NDPI_PARAM_ISSUER_DN, flow.host_server_name}, + { NDPI_PARAM_ISSUER_DN, (void *)("CN=813845657003339838, O=Code42, OU=TEST, ST=MN, C=US") /* from example/protos.txt */}, { NDPI_PARAM_HOST_IPV4, &flow.c_address.v4} }; ndpi_check_flow_risk_exceptions(ndpi_info_mod, 3, params); } diff --git a/fuzz/fuzz_ds_tree.cpp b/fuzz/fuzz_ds_tree.cpp index d06b5b19f..5e561e2e6 100644 --- a/fuzz/fuzz_ds_tree.cpp +++ b/fuzz/fuzz_ds_tree.cpp @@ -46,7 +46,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { *entry = fuzzed_data.ConsumeIntegral<u_int32_t>(); if(ndpi_tfind(entry, &root, __compare) == NULL) { - if(ndpi_tsearch(entry, &root, __compare) == NULL) { + if(ndpi_tsearch(entry, fuzzed_data.ConsumeBool() ? &root : NULL, __compare) == NULL) { ndpi_free(entry); } else { /* Keep one random entry really added */ @@ -65,7 +65,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { for (i = 0; i < num_iteration; i++) { e = fuzzed_data.ConsumeIntegral<u_int32_t>(); - ndpi_tfind(&e, &root, __compare); + ndpi_tfind(&e, fuzzed_data.ConsumeBool() ? &root : NULL, __compare); } /* Search of an added node */ if (is_added) { diff --git a/fuzz/fuzz_gcrypt_light.cpp b/fuzz/fuzz_gcrypt_light.cpp index 043a90d0d..0186c93a2 100644 --- a/fuzz/fuzz_gcrypt_light.cpp +++ b/fuzz/fuzz_gcrypt_light.cpp @@ -125,6 +125,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { gpg_strerror_r(rc, buf_err, sizeof(buf_err)); + gpg_strerror_r(static_cast<gcry_error_t>(fuzzed_data.ConsumeIntegral<u_int16_t>()), buf_err, sizeof(buf_err)); + ndpi_free(enc_out); return 0; diff --git a/src/include/ndpi_private.h b/src/include/ndpi_private.h index a88b0c43a..432b829df 100644 --- a/src/include/ndpi_private.h +++ b/src/include/ndpi_private.h @@ -465,6 +465,9 @@ char* ndpi_intoav4(unsigned int addr, char* buf, u_int16_t bufLen); u_int16_t icmp4_checksum(u_int8_t const * const buf, size_t len); +ndpi_risk_enum ndpi_network_risk_ptree_match(struct ndpi_detection_module_struct *ndpi_str, + struct in_addr *pin /* network byte order */); + int load_protocols_file_fd(struct ndpi_detection_module_struct *ndpi_mod, FILE *fd); int load_categories_file_fd(struct ndpi_detection_module_struct *ndpi_str, FILE *fd, void *user_data); int load_malicious_sha1_file_fd(struct ndpi_detection_module_struct *ndpi_str, FILE *fd); diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 96c7e7cb5..d05032b57 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -2603,6 +2603,9 @@ ndpi_risk_enum ndpi_network_risk_ptree_match(struct ndpi_detection_module_struct ndpi_prefix_t prefix; ndpi_patricia_node_t *node; + if(!ndpi_str || !ndpi_str->ip_risk_ptree) + return(NDPI_NO_RISK); + /* Make sure all in network byte order otherwise compares wont work */ ndpi_fill_prefix_v4(&prefix, pin, 32, ((ndpi_patricia_tree_t *) ndpi_str->ip_risk_ptree)->maxbits); node = ndpi_patricia_search_best(ndpi_str->ip_risk_ptree, &prefix); @@ -4918,11 +4921,15 @@ int load_category_file_fd(struct ndpi_detection_module_struct *ndpi_str, */ int ndpi_load_categories_dir(struct ndpi_detection_module_struct *ndpi_str, char *dir_path) { - DIR *dirp = opendir(dir_path); + DIR *dirp; struct dirent *dp; int failed_files = 0; int num_loaded = 0; + if(!ndpi_str || !dir_path) + return(0); + + dirp = opendir(dir_path); if (dirp == NULL) return(0); @@ -11102,9 +11109,12 @@ char *ndpi_get_config(struct ndpi_detection_module_struct *ndpi_str, NDPI_LOG_DBG(ndpi_str, "Get [%s][%s]\n", proto, param); for(c = &cfg_params[0]; c && c->param; c++) { - if(((proto == NULL && c->proto == NULL) || - (proto && c->proto && strcmp(proto, c->proto) == 0)) && - strcmp(param, c->param) == 0) { + if((((proto == NULL && c->proto == NULL) || + (proto && c->proto && strcmp(proto, c->proto) == 0)) && + strcmp(param, c->param) == 0) || + (proto && c->proto && + strcmp(c->proto, "$PROTO_NAME_OR_ID") == 0 && + strcmp(param, c->param) == 0)) { return cfg_ops[c->type].fn_get((void *)((char *)&ndpi_str->cfg + c->offset), proto, buf, buf_len); } diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index b80485c96..17e15b839 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -2955,13 +2955,8 @@ u_int8_t ndpi_check_flow_risk_exceptions(struct ndpi_detection_module_struct *nd return(1); break; - case NDPI_MAX_RISK_PARAM_ID: - /* Nothing to do, just avoid warnings */ - break; - default: - printf("nDPI [%s:%u] Ignored risk parameter id %u\n", - __FILE__, __LINE__, params[i].id); + NDPI_LOG_ERR(ndpi_str, "Ignored risk parameter id %u\n", params[i].id); break; } } diff --git a/src/lib/protocols/jabber.c b/src/lib/protocols/jabber.c index 552d2618f..53ec251c5 100644 --- a/src/lib/protocols/jabber.c +++ b/src/lib/protocols/jabber.c @@ -53,8 +53,6 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_ struct ndpi_packet_struct *packet = &ndpi_struct->packet; int i, left = packet->payload_packet_len-x; - if(left <= 0) return; - for(i=0; jabber_strings[i].string != NULL; i++) { if(ndpi_strnstr((const char*)&packet->payload[x], jabber_strings[i].string, left) != NULL) { ndpi_int_jabber_add_connection(ndpi_struct, flow, jabber_strings[i].ndpi_protocol, NDPI_CONFIDENCE_DPI); diff --git a/tests/cfgs/default/pcap/ossfuzz_seed_fake_traces_2.pcapng b/tests/cfgs/default/pcap/ossfuzz_seed_fake_traces_2.pcapng Binary files differindex 260633932..5b387db9a 100644 --- a/tests/cfgs/default/pcap/ossfuzz_seed_fake_traces_2.pcapng +++ b/tests/cfgs/default/pcap/ossfuzz_seed_fake_traces_2.pcapng diff --git a/tests/cfgs/default/result/ossfuzz_seed_fake_traces_2.pcapng.out b/tests/cfgs/default/result/ossfuzz_seed_fake_traces_2.pcapng.out index ecea4b379..fd4520ec4 100644 --- a/tests/cfgs/default/result/ossfuzz_seed_fake_traces_2.pcapng.out +++ b/tests/cfgs/default/result/ossfuzz_seed_fake_traces_2.pcapng.out @@ -1,10 +1,10 @@ Guessed flow protos: 1 -DPI Packets (TCP): 30 (7.50 pkts/flow) +DPI Packets (TCP): 38 (6.33 pkts/flow) DPI Packets (UDP): 4 (2.00 pkts/flow) Confidence Match by port : 1 (flows) -Confidence DPI : 5 (flows) -Num dissector calls: 956 (159.33 diss/flow) +Confidence DPI : 7 (flows) +Num dissector calls: 982 (122.75 diss/flow) LRU cache ookla: 0/0/0 (insert/search/found) LRU cache bittorrent: 0/3/0 (insert/search/found) LRU cache zoom: 0/0/0 (insert/search/found) @@ -22,19 +22,22 @@ Patricia risk mask: 0/0 (search/found) Patricia risk mask IPv6: 0/0 (search/found) Patricia risk: 0/0 (search/found) Patricia risk IPv6: 0/0 (search/found) -Patricia protocols: 12/0 (search/found) +Patricia protocols: 16/0 (search/found) Patricia protocols IPv6: 0/0 (search/found) PostgreSQL 10 689 1 Usenet 12 1099 2 +TruPhone 16 1326 2 TeamViewer 59 31448 1 WireGuard 4 592 2 -Acceptable 85 33828 6 +Acceptable 101 35154 8 1 TCP 192.168.0.1:8787 <-> 10.10.10.1:32177 [proto: 148/TeamViewer][IP: 0/Unknown][Encrypted][Confidence: DPI][DPI packets: 12][cat: RemoteAccess/12][25 pkts/14755 bytes <-> 34 pkts/16693 bytes][Goodput ratio: 90/89][2.12 sec][bytes ratio: -0.062 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/0 79/59 277/257 105/90][Pkt Len c2s/s2c min/avg/max/stddev: 60/54 590/491 1514/1514 585/593][Risk: ** Known Proto on Non Std Port **][Risk Score: 50][PLAIN TEXT (XDsiBZ)][Plen Bins: 0,19,2,5,2,0,0,0,0,0,0,5,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,15,5,0,2,2,2,0,0,0,0,0,0,29,0,0] 2 TCP 172.16.20.244:59038 <-> 172.16.20.75:5432 [proto: 19/PostgreSQL][IP: 0/Unknown][ClearText][Confidence: DPI][DPI packets: 6][cat: Database/11][6 pkts/416 bytes <-> 4 pkts/273 bytes][Goodput ratio: 2/0][0.02 sec][bytes ratio: 0.208 (Upload)][IAT c2s/s2c min/avg/max/stddev: 0/0 4/9 17/18 7/9][Pkt Len c2s/s2c min/avg/max/stddev: 66/66 69/68 78/74 5/3][Plen Bins: 100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] - 3 TCP 172.26.235.166:55630 <-> 172.30.92.62:119 [proto: 93/Usenet][IP: 0/Unknown][ClearText][Confidence: DPI][DPI packets: 6][cat: Web/5][4 pkts/293 bytes <-> 2 pkts/264 bytes][Goodput ratio: 7/47][0.02 sec][bytes ratio: 0.052 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/17 6/17 17/17 8/0][Pkt Len c2s/s2c min/avg/max/stddev: 66/74 73/132 87/190 9/58][PLAIN TEXT (200 Leafnode NNTP Daemon)][Plen Bins: 50,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] - 4 TCP 192.168.190.20:55630 <-> 192.168.190.5:119 [proto: 93/Usenet][IP: 0/Unknown][ClearText][Confidence: DPI][DPI packets: 6][cat: Web/5][4 pkts/278 bytes <-> 2 pkts/264 bytes][Goodput ratio: 2/47][0.02 sec][bytes ratio: 0.026 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/17 6/17 17/17 8/0][Pkt Len c2s/s2c min/avg/max/stddev: 66/74 70/132 74/190 4/58][PLAIN TEXT (200 Leafnode NNTP Daemon)][Plen Bins: 50,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] - 5 UDP 10.9.0.1:43462 <-> 10.9.0.2:51820 [proto: 206/WireGuard][IP: 0/Unknown][Encrypted][Confidence: DPI][DPI packets: 2][cat: VPN/2][1 pkts/190 bytes <-> 1 pkts/106 bytes][Goodput ratio: 77/60][0.00 sec][Plen Bins: 0,0,50,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] - 6 UDP 10.147.205.42:43462 <-> 10.45.123.132:51820 [proto: 206/WireGuard][IP: 0/Unknown][Encrypted][Confidence: Match by port][DPI packets: 2][cat: VPN/2][1 pkts/190 bytes <-> 1 pkts/106 bytes][Goodput ratio: 77/60][0.00 sec][Plen Bins: 0,0,50,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + 3 TCP 127.0.0.1:54898 <-> 127.0.0.1:1299 [proto: 101/TruPhone][IP: 0/Unknown][ClearText][Confidence: DPI][DPI packets: 4][cat: VoIP/10][5 pkts/457 bytes <-> 3 pkts/206 bytes][Goodput ratio: 26/0][8.94 sec][bytes ratio: 0.379 (Upload)][IAT c2s/s2c min/avg/max/stddev: 0/7477 2235/7477 7477/7477 3085/0][Pkt Len c2s/s2c min/avg/max/stddev: 66/66 91/69 185/74 47/4][PLAIN TEXT (stream)][Plen Bins: 0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + 4 TCP 127.0.0.1:55536 <-> 127.0.0.1:1299 [proto: 101/TruPhone][IP: 0/Unknown][ClearText][Confidence: DPI][DPI packets: 4][cat: VoIP/10][5 pkts/457 bytes <-> 3 pkts/206 bytes][Goodput ratio: 26/0][20.44 sec][bytes ratio: 0.379 (Upload)][IAT c2s/s2c min/avg/max/stddev: 0/6290 5110/6290 14151/6290 5817/0][Pkt Len c2s/s2c min/avg/max/stddev: 66/66 91/69 185/74 47/4][PLAIN TEXT (stream)][Plen Bins: 0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + 5 TCP 172.26.235.166:55630 <-> 172.30.92.62:119 [proto: 93/Usenet][IP: 0/Unknown][ClearText][Confidence: DPI][DPI packets: 6][cat: Web/5][4 pkts/293 bytes <-> 2 pkts/264 bytes][Goodput ratio: 7/47][0.02 sec][bytes ratio: 0.052 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/17 6/17 17/17 8/0][Pkt Len c2s/s2c min/avg/max/stddev: 66/74 73/132 87/190 9/58][PLAIN TEXT (200 Leafnode NNTP Daemon)][Plen Bins: 50,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + 6 TCP 192.168.190.20:55630 <-> 192.168.190.5:119 [proto: 93/Usenet][IP: 0/Unknown][ClearText][Confidence: DPI][DPI packets: 6][cat: Web/5][4 pkts/278 bytes <-> 2 pkts/264 bytes][Goodput ratio: 2/47][0.02 sec][bytes ratio: 0.026 (Mixed)][IAT c2s/s2c min/avg/max/stddev: 0/17 6/17 17/17 8/0][Pkt Len c2s/s2c min/avg/max/stddev: 66/74 70/132 74/190 4/58][PLAIN TEXT (200 Leafnode NNTP Daemon)][Plen Bins: 50,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + 7 UDP 10.9.0.1:43462 <-> 10.9.0.2:51820 [proto: 206/WireGuard][IP: 0/Unknown][Encrypted][Confidence: DPI][DPI packets: 2][cat: VPN/2][1 pkts/190 bytes <-> 1 pkts/106 bytes][Goodput ratio: 77/60][0.00 sec][Plen Bins: 0,0,50,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + 8 UDP 10.147.205.42:43462 <-> 10.45.123.132:51820 [proto: 206/WireGuard][IP: 0/Unknown][Encrypted][Confidence: Match by port][DPI packets: 2][cat: VPN/2][1 pkts/190 bytes <-> 1 pkts/106 bytes][Goodput ratio: 77/60][0.00 sec][Plen Bins: 0,0,50,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] |