diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2024-02-09 19:19:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-09 19:19:03 +0100 |
commit | 03ecb026ff4d0e545cf21d463807b40265441bb3 (patch) | |
tree | fee3fca194dc2dd113e3b6dee782cc8b220f77e4 /fuzz/fuzz_alg_crc32_md5.c | |
parent | f5cec001f38f88cc0cdd8892dc6182dd8d7eafd0 (diff) |
fuzz: improve fuzzing coverage (#2309)
Diffstat (limited to 'fuzz/fuzz_alg_crc32_md5.c')
-rw-r--r-- | fuzz/fuzz_alg_crc32_md5.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |