fuzz: some improvements and add two new fuzzers (#1881)
Remove `FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION` define from `fuzz/Makefile.am`; it is already included by the main configure script (when fuzzing). Add a knob to force disabling of AESNI optimizations: this way we can fuzz also no-aesni crypto code. Move CRC32 algorithm into the library. Add some fake traces to extend fuzzing coverage. Note that these traces are hand-made (via scapy/curl) and must not be used as "proof" that the dissectors are really able to identify this kind of traffic. Some small updates to some dissectors: CSGO: remove a wrong rule (never triggered, BTW). Any UDP packet starting with "VS01" will be classified as STEAM (see steam.c around line 111). Googling it, it seems right so. XBOX: XBOX only analyses UDP flows while HTTP only TCP ones; therefore that condition is false. RTP, STUN: removed useless "break"s Zattoo: `flow->zattoo_stage` is never set to any values greater or equal to 5, so these checks are never true. PPStream: `flow->l4.udp.ppstream_stage` is never read. Delete it. TeamSpeak: we check for `flow->packet_counter == 3` just above, so the following check `flow->packet_counter >= 3` is always false.
This commit is contained in:
@@ -1713,6 +1713,10 @@ extern "C" {
|
||||
|
||||
/* ******************************* */
|
||||
|
||||
u_int32_t ndpi_crc32(const void* data, size_t n_bytes);
|
||||
|
||||
/* ******************************* */
|
||||
|
||||
int ndpi_des_init(struct ndpi_des_struct *des, double alpha, double beta, float significance);
|
||||
int ndpi_des_add_value(struct ndpi_des_struct *des, const double _value, double *forecast, double *confidence_band);
|
||||
void ndpi_des_fitting(double *values, u_int32_t num_values, float *ret_alpha, float *ret_beta);
|
||||
|
||||
@@ -125,6 +125,8 @@ extern "C" {
|
||||
|
||||
extern u_int8_t ndpi_is_proto(ndpi_protocol proto, u_int16_t p);
|
||||
|
||||
extern void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
|
||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const char **file, const char **func, u_int32_t * line);
|
||||
|
||||
@@ -49,7 +49,6 @@ u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struc
|
||||
u_int32_t saddr, u_int32_t daddr,
|
||||
u_int16_t sport, u_int16_t dport);
|
||||
|
||||
void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
|
||||
void init_diameter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id);
|
||||
void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id);
|
||||
|
||||
@@ -769,9 +769,6 @@ struct ndpi_flow_tcp_struct {
|
||||
/* ************************************************** */
|
||||
|
||||
struct ndpi_flow_udp_struct {
|
||||
/* NDPI_PROTOCOL_PPSTREAM */
|
||||
u_int32_t ppstream_stage:3; // 0 - 7
|
||||
|
||||
/* NDPI_PROTOCOL_HALFLIFE2 */
|
||||
u_int32_t halflife2_stage:2; // 0 - 2
|
||||
|
||||
|
||||
+55
-1
@@ -135,7 +135,7 @@ float ndpi_data_average(struct ndpi_analyze_struct *s) {
|
||||
/* ********************************************************************************* */
|
||||
|
||||
u_int32_t ndpi_data_last(struct ndpi_analyze_struct *s) {
|
||||
if((!s) || (s->num_data_entries == 0) || (s->sum_total == 0))
|
||||
if((!s) || (s->num_data_entries == 0) || (s->num_values_array_len == 0))
|
||||
return(0);
|
||||
|
||||
if(s->next_value_insert_index == 0)
|
||||
@@ -1586,3 +1586,57 @@ u_int ndpi_find_outliers(u_int32_t *values, bool *outliers, u_int32_t num_values
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* ************************************************************/
|
||||
|
||||
/* ********************************************************** */
|
||||
/* http://home.thep.lu.se/~bjorn/crc/crc32_fast.c */
|
||||
/* ********************************************************** */
|
||||
|
||||
static uint32_t crc32_for_byte(uint32_t r) {
|
||||
int j;
|
||||
|
||||
for(j = 0; j < 8; ++j)
|
||||
r = ((r & 1) ? 0 : (uint32_t)0xEDB88320L) ^ r >> 1;
|
||||
return r ^ (uint32_t)0xFF000000L;
|
||||
}
|
||||
|
||||
/* Any unsigned integer type with at least 32 bits may be used as
|
||||
* accumulator type for fast crc32-calulation, but unsigned long is
|
||||
* probably the optimal choice for most systems. */
|
||||
typedef unsigned long accum_t;
|
||||
|
||||
static void init_tables(uint32_t* table, uint32_t* wtable) {
|
||||
size_t i, j, k, w;
|
||||
|
||||
for(i = 0; i < 0x100; ++i)
|
||||
table[i] = crc32_for_byte(i);
|
||||
for(k = 0; k < sizeof(accum_t); ++k)
|
||||
for(i = 0; i < 0x100; ++i) {
|
||||
for(j = w = 0; j < sizeof(accum_t); ++j)
|
||||
w = table[(uint8_t)(j == k? w ^ i: w)] ^ w >> 8;
|
||||
wtable[(k << 8) + i] = w ^ (k? wtable[0]: 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void __crc32(const void* data, size_t n_bytes, uint32_t* crc) {
|
||||
static uint32_t table[0x100], wtable[0x100*sizeof(accum_t)];
|
||||
size_t n_accum = n_bytes/sizeof(accum_t);
|
||||
size_t i, j;
|
||||
|
||||
if(!*table)
|
||||
init_tables(table, wtable);
|
||||
for(i = 0; i < n_accum; ++i) {
|
||||
accum_t a = *crc ^ ((accum_t*)data)[i];
|
||||
for(j = *crc = 0; j < sizeof(accum_t); ++j)
|
||||
*crc ^= wtable[(j << 8) + (uint8_t)(a >> 8*j)];
|
||||
}
|
||||
for(i = n_accum*sizeof(accum_t); i < n_bytes; ++i)
|
||||
*crc = table[(uint8_t)*crc ^ ((uint8_t*)data)[i]] ^ *crc >> 8;
|
||||
}
|
||||
|
||||
u_int32_t ndpi_crc32(const void* data, size_t n_bytes) {
|
||||
u_int32_t crc = 0;
|
||||
|
||||
__crc32(data, n_bytes, &crc);
|
||||
return crc;
|
||||
}
|
||||
|
||||
+33
-12
@@ -339,6 +339,8 @@ u_int32_t ndpi_detection_get_sizeof_ndpi_flow_udp_struct(void) {
|
||||
/* *********************************************************************************** */
|
||||
|
||||
char *ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_str, u_int id) {
|
||||
if(!ndpi_str)
|
||||
return NULL;
|
||||
return((id >= ndpi_str->ndpi_num_supported_protocols) ? NULL : ndpi_str->proto_defaults[id].protoName);
|
||||
}
|
||||
|
||||
@@ -346,10 +348,16 @@ char *ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_str, u_int
|
||||
|
||||
u_int16_t ndpi_get_proto_by_name(struct ndpi_detection_module_struct *ndpi_str, const char *name) {
|
||||
u_int16_t i, num = ndpi_get_num_supported_protocols(ndpi_str);
|
||||
char *p;
|
||||
|
||||
for(i = 0; i < num; i++)
|
||||
if(strcasecmp(ndpi_get_proto_by_id(ndpi_str, i), name) == 0)
|
||||
if(!ndpi_str || !name)
|
||||
return(NDPI_PROTOCOL_UNKNOWN);
|
||||
|
||||
for(i = 0; i < num; i++) {
|
||||
p = ndpi_get_proto_by_id(ndpi_str, i);
|
||||
if(p && strcasecmp(p, name) == 0)
|
||||
return(i);
|
||||
}
|
||||
|
||||
return(NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
@@ -402,7 +410,7 @@ void ndpi_set_proto_breed(struct ndpi_detection_module_struct *ndpi_str,
|
||||
u_int16_t protoId, ndpi_protocol_breed_t breed) {
|
||||
if(!ndpi_is_valid_protoId(protoId))
|
||||
return;
|
||||
else
|
||||
else if(ndpi_str)
|
||||
ndpi_str->proto_defaults[protoId].protoBreed = breed;
|
||||
}
|
||||
|
||||
@@ -412,7 +420,7 @@ void ndpi_set_proto_category(struct ndpi_detection_module_struct *ndpi_str, u_in
|
||||
ndpi_protocol_category_t protoCategory) {
|
||||
if(!ndpi_is_valid_protoId(protoId))
|
||||
return;
|
||||
else
|
||||
else if(ndpi_str)
|
||||
ndpi_str->proto_defaults[protoId].protoCategory = protoCategory;
|
||||
}
|
||||
|
||||
@@ -2167,6 +2175,8 @@ int ac_domain_match_handler(AC_MATCH_t *m, AC_TEXT_t *txt, AC_REP_t *match) {
|
||||
/* ******************************************************************** */
|
||||
|
||||
u_int16_t ndpi_patricia_get_maxbits(ndpi_patricia_tree_t *tree) {
|
||||
if(!tree)
|
||||
return 0;
|
||||
return(tree->maxbits);
|
||||
}
|
||||
|
||||
@@ -3261,7 +3271,7 @@ int ndpi_get_custom_category_match(struct ndpi_detection_module_struct *ndpi_str
|
||||
ndpi_patricia_node_t *node;
|
||||
|
||||
/* Make sure all in network byte order otherwise compares wont work */
|
||||
ndpi_fill_prefix_v4(&prefix, &pin, 32, ((ndpi_patricia_tree_t *) ndpi_str->protocols_ptree)->maxbits);
|
||||
ndpi_fill_prefix_v4(&prefix, &pin, 32, ((ndpi_patricia_tree_t *) ndpi_str->custom_categories.ipAddresses)->maxbits);
|
||||
node = ndpi_patricia_search_best(ndpi_str->custom_categories.ipAddresses, &prefix);
|
||||
|
||||
if(node) {
|
||||
@@ -3560,7 +3570,7 @@ u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_str,
|
||||
/* ******************************************************************** */
|
||||
|
||||
u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_str) {
|
||||
return(ndpi_str->ndpi_num_supported_protocols);
|
||||
return(ndpi_str ? ndpi_str->ndpi_num_supported_protocols : 0);
|
||||
}
|
||||
|
||||
/* ******************************************************************** */
|
||||
@@ -6354,14 +6364,14 @@ int ndpi_fill_ip_protocol_category(struct ndpi_detection_module_struct *ndpi_str
|
||||
else {
|
||||
/* Make sure all in network byte order otherwise compares wont work */
|
||||
ndpi_fill_prefix_v4(&prefix, (struct in_addr *) &saddr, 32,
|
||||
((ndpi_patricia_tree_t *) ndpi_str->protocols_ptree)->maxbits);
|
||||
((ndpi_patricia_tree_t *) ndpi_str->custom_categories.ipAddresses)->maxbits);
|
||||
node = ndpi_patricia_search_best(ndpi_str->custom_categories.ipAddresses, &prefix);
|
||||
}
|
||||
|
||||
if(!node) {
|
||||
if(daddr != 0) {
|
||||
ndpi_fill_prefix_v4(&prefix, (struct in_addr *) &daddr, 32,
|
||||
((ndpi_patricia_tree_t *) ndpi_str->protocols_ptree)->maxbits);
|
||||
((ndpi_patricia_tree_t *) ndpi_str->custom_categories.ipAddresses)->maxbits);
|
||||
node = ndpi_patricia_search_best(ndpi_str->custom_categories.ipAddresses, &prefix);
|
||||
}
|
||||
}
|
||||
@@ -7843,7 +7853,7 @@ int ndpi_is_custom_category(ndpi_protocol_category_t category) {
|
||||
void ndpi_category_set_name(struct ndpi_detection_module_struct *ndpi_str,
|
||||
ndpi_protocol_category_t category,
|
||||
char *name) {
|
||||
if(!name)
|
||||
if(!ndpi_str || !name)
|
||||
return;
|
||||
|
||||
switch(category) {
|
||||
@@ -8853,10 +8863,15 @@ void ndpi_ptree_destroy(ndpi_ptree_t *tree) {
|
||||
int ndpi_ptree_insert(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr,
|
||||
u_int8_t bits, u_int64_t user_data) {
|
||||
u_int8_t is_v6 = ndpi_is_ipv6(addr);
|
||||
ndpi_patricia_tree_t *ptree = is_v6 ? tree->v6 : tree->v4;
|
||||
ndpi_patricia_tree_t *ptree;
|
||||
ndpi_prefix_t prefix;
|
||||
ndpi_patricia_node_t *node;
|
||||
|
||||
if(!tree)
|
||||
return(-4);
|
||||
|
||||
ptree = is_v6 ? tree->v6 : tree->v4;
|
||||
|
||||
if(bits > ptree->maxbits)
|
||||
return(-1);
|
||||
|
||||
@@ -8887,10 +8902,16 @@ int ndpi_ptree_insert(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr,
|
||||
int ndpi_ptree_match_addr(ndpi_ptree_t *tree,
|
||||
const ndpi_ip_addr_t *addr, u_int64_t *user_data) {
|
||||
u_int8_t is_v6 = ndpi_is_ipv6(addr);
|
||||
ndpi_patricia_tree_t *ptree = is_v6 ? tree->v6 : tree->v4;
|
||||
ndpi_patricia_tree_t *ptree;
|
||||
ndpi_prefix_t prefix;
|
||||
ndpi_patricia_node_t *node;
|
||||
int bits = ptree->maxbits;
|
||||
int bits;
|
||||
|
||||
if(!tree)
|
||||
return(-2);
|
||||
|
||||
ptree = is_v6 ? tree->v6 : tree->v4;
|
||||
bits = ptree->maxbits;
|
||||
|
||||
if(is_v6)
|
||||
ndpi_fill_prefix_v6(&prefix, (const struct in6_addr *) &addr->ipv6, bits, ptree->maxbits);
|
||||
|
||||
@@ -199,7 +199,7 @@ void ndpi_serializer_skip_header(ndpi_serializer *_serializer) {
|
||||
|
||||
static int ndpi_init_serializer_buffer(ndpi_private_serializer_buffer *buffer, u_int32_t buffer_size) {
|
||||
buffer->initial_size = buffer->size = buffer_size;
|
||||
buffer->data = (u_int8_t *) calloc(buffer->size, sizeof(u_int8_t));
|
||||
buffer->data = (u_int8_t *)ndpi_calloc(buffer->size, sizeof(u_int8_t));
|
||||
if(buffer->data == NULL)
|
||||
return(-1);
|
||||
|
||||
@@ -2246,6 +2246,8 @@ int ndpi_serialize_end_of_list(ndpi_serializer *_serializer) {
|
||||
|
||||
serializer->status.flags &= ~NDPI_SERIALIZER_STATUS_LIST;
|
||||
} else {
|
||||
if(serializer->status.buffer.size_used == serializer->buffer.size)
|
||||
return(-1);
|
||||
serializer->buffer.data[serializer->status.buffer.size_used++] = ndpi_serialization_end_of_list;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,12 +62,6 @@ static void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, s
|
||||
return;
|
||||
}
|
||||
|
||||
if(packet->payload_packet_len >= 36 && w == 0x56533031ul) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
if(packet->payload_packet_len >= 36 && w == 0x01007364) {
|
||||
uint32_t w2 = htonl(get_u_int32_t(packet->payload, 4));
|
||||
if(w2 == 0x70696e67) {
|
||||
|
||||
@@ -68,9 +68,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
packet->payload[13] == 0x00 &&
|
||||
packet->payload[14] == 0x00) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -92,9 +89,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
packet->payload[19] == 0x00 &&
|
||||
packet->payload[20] == 0x00) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -105,9 +99,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
packet->payload[19] == 0xff &&
|
||||
packet->payload[20] == 0xff) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -128,9 +119,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
packet->payload[19] == 0x00 &&
|
||||
packet->payload[20] == 0x00) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -147,9 +135,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
packet->payload[100] == 0x61 &&
|
||||
packet->payload[101] == 0x6d) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -166,9 +151,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
packet->payload[19] == 0x00 &&
|
||||
packet->payload[20] == 0x00 )) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -187,9 +169,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
packet->payload[19] == 0x00 &&
|
||||
packet->payload[20] == 0x00 )) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -200,9 +179,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
if(packet->payload[1] == 0x80 || packet->payload[1] == 0x84 ) {
|
||||
if(packet->payload[3] == packet->payload[4]) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -211,9 +187,6 @@ static void ndpi_search_ppstream(struct ndpi_detection_module_struct
|
||||
else if(packet->payload[1] == 0x53 && packet->payload[3] == 0x00 &&
|
||||
(packet->payload[0] == 0x08 || packet->payload[0] == 0x0c)) {
|
||||
|
||||
/* increase count pkt ppstream over udp */
|
||||
flow->l4.udp.ppstream_stage++;
|
||||
|
||||
ndpi_int_ppstream_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -246,6 +246,7 @@ static uint16_t gquic_get_u16(const uint8_t *buf, uint32_t version)
|
||||
}
|
||||
|
||||
|
||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||
static char *__gcry_err(gpg_error_t err, char *buf, size_t buflen)
|
||||
{
|
||||
gpg_strerror_r(err, buf, buflen);
|
||||
@@ -255,6 +256,7 @@ static char *__gcry_err(gpg_error_t err, char *buf, size_t buflen)
|
||||
buf[buflen - 1] = '\0';
|
||||
return buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
static uint64_t pntoh64(const void *p)
|
||||
{
|
||||
|
||||
@@ -54,7 +54,6 @@ static u_int8_t isValidMSRTPType(u_int8_t payloadType, enum ndpi_rtp_stream_type
|
||||
case 118: /* Comfort Noise Wideband */
|
||||
*s_type = rtp_audio;
|
||||
return(1 /* RTP */);
|
||||
break;
|
||||
|
||||
case 34: /* H.263 [MS-H26XPF] */
|
||||
case 121: /* RT Video */
|
||||
@@ -63,7 +62,6 @@ static u_int8_t isValidMSRTPType(u_int8_t payloadType, enum ndpi_rtp_stream_type
|
||||
case 127: /* x-data */
|
||||
*s_type = rtp_video;
|
||||
return(1 /* RTP */);
|
||||
break;
|
||||
|
||||
case 200: /* RTCP PACKET SENDER */
|
||||
case 201: /* RTCP PACKET RECEIVER */
|
||||
@@ -71,7 +69,6 @@ static u_int8_t isValidMSRTPType(u_int8_t payloadType, enum ndpi_rtp_stream_type
|
||||
case 203: /* RTCP Bye */
|
||||
*s_type = rtp_unknown;
|
||||
return(2 /* RTCP */);
|
||||
break;
|
||||
|
||||
default:
|
||||
return(0);
|
||||
|
||||
@@ -326,7 +326,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
|
||||
case 0x0103:
|
||||
*app_proto = NDPI_PROTOCOL_ZOOM;
|
||||
return(NDPI_IS_STUN);
|
||||
break;
|
||||
|
||||
case 0x4000:
|
||||
case 0x4001:
|
||||
@@ -334,7 +333,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
|
||||
/* These are the only messages apparently whatsapp voice can use */
|
||||
*app_proto = NDPI_PROTOCOL_WHATSAPP_CALL;
|
||||
return(NDPI_IS_STUN);
|
||||
break;
|
||||
|
||||
case 0x0014: /* Realm */
|
||||
{
|
||||
@@ -406,7 +404,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
|
||||
|
||||
*app_proto = NDPI_PROTOCOL_SKYPE_TEAMS_CALL;
|
||||
return(NDPI_IS_STUN);
|
||||
break;
|
||||
|
||||
case 0x8070: /* Implementation Version */
|
||||
if(len == 4 && ((offset+7) < payload_length)
|
||||
@@ -424,7 +421,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
|
||||
case 0xFF03:
|
||||
*app_proto = NDPI_PROTOCOL_HANGOUT_DUO;
|
||||
return(NDPI_IS_STUN);
|
||||
break;
|
||||
|
||||
default:
|
||||
#ifdef DEBUG_STUN
|
||||
|
||||
@@ -53,11 +53,13 @@ void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
{
|
||||
u_int16_t sport, dport;
|
||||
u_int proto;
|
||||
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
|
||||
struct ndpi_packet_struct *packet;
|
||||
|
||||
if(flow->host_server_name[0] != '\0')
|
||||
if(!ndpi_struct || !flow || flow->host_server_name[0] != '\0')
|
||||
return;
|
||||
|
||||
packet = &ndpi_struct->packet;
|
||||
|
||||
if(packet->udp) sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
||||
else if(packet->tcp) sport = ntohs(packet->tcp->source), dport = ntohs(packet->tcp->dest);
|
||||
else sport = dport = 0;
|
||||
|
||||
@@ -90,10 +90,6 @@ ts3_license_weblist:
|
||||
ndpi_int_teamspeak_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
if (flow->packet_counter >= 3)
|
||||
{
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
|
||||
void init_teamspeak_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id)
|
||||
|
||||
@@ -91,13 +91,7 @@ static void ndpi_search_xbox(struct ndpi_detection_module_struct *ndpi_struct, s
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* exclude here all non matched udp traffic, exclude here tcp only if http has been excluded, because xbox could use http */
|
||||
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HTTP) != 0) {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
/* to not exclude tcp traffic here, done by http code... */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -170,17 +170,6 @@ static void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
ZATTOO_DETECTED;
|
||||
return;
|
||||
|
||||
} else if(flow->zattoo_stage == 5 + packet->packet_direction && (packet->payload_packet_len == 125)) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found zattoo\n");
|
||||
ZATTOO_DETECTED;
|
||||
return;
|
||||
|
||||
} else if(flow->zattoo_stage == 6 - packet->packet_direction && packet->payload_packet_len == 1412) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found zattoo\n");
|
||||
ZATTOO_DETECTED;
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_LOG_DBG2(ndpi_struct,
|
||||
|
||||
+9
@@ -49,6 +49,10 @@
|
||||
static u_int8_t cached_has_aesni = 0, has_aesni_checked = 0;
|
||||
#endif
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
int force_no_aesni = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AES-NI support detection routine
|
||||
*/
|
||||
@@ -60,6 +64,11 @@ int mbedtls_aesni_has_support( unsigned int what )
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
if(force_no_aesni == 1)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
#if defined(linux) || defined(__linux__)
|
||||
if(has_aesni_checked == 0) {
|
||||
/*
|
||||
|
||||
Vendored
-4
@@ -30,10 +30,6 @@
|
||||
#include "../include/MurmurHash3.h"
|
||||
#include "../include/hll.h"
|
||||
|
||||
u_int32_t _hll_hash(const struct ndpi_hll *hll) {
|
||||
return MurmurHash3_x86_32(hll->registers, (u_int32_t)hll->size, 0);
|
||||
}
|
||||
|
||||
/* Count the number of leading zero's */
|
||||
static __inline u_int8_t _hll_rank(u_int32_t hash, u_int8_t bits) {
|
||||
u_int8_t i;
|
||||
|
||||
Reference in New Issue
Block a user