diff options
-rw-r--r-- | src/lib/ndpi_main.c | 3 | ||||
-rw-r--r-- | src/lib/protocols/hangout.c | 7 | ||||
-rw-r--r-- | src/lib/protocols/tls.c | 6 |
3 files changed, 4 insertions, 12 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 851b47a81..4f96120e0 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -49,9 +49,6 @@ #include "third_party/include/ndpi_patricia.h" #include "third_party/include/ndpi_md5.h" -/* stun.c */ -extern u_int32_t get_stun_lru_key(struct ndpi_flow_struct *flow, u_int8_t rev); - static int _ndpi_debug_callbacks = 0; /* #define DGA_DEBUG 1 */ diff --git a/src/lib/protocols/hangout.c b/src/lib/protocols/hangout.c index 8d33198fd..6edb6b178 100644 --- a/src/lib/protocols/hangout.c +++ b/src/lib/protocols/hangout.c @@ -27,7 +27,7 @@ #include "ndpi_api.h" /* stun.c */ -extern u_int32_t get_stun_lru_key(struct ndpi_flow_struct *flow); +extern u_int32_t get_stun_lru_key(struct ndpi_flow_struct *flow, u_int8_t rev); /* https://support.google.com/a/answer/1279090?hl=en */ #define HANGOUT_UDP_LOW_PORT 19302 @@ -88,8 +88,9 @@ void ndpi_search_hangout(struct ndpi_detection_module_struct *ndpi_struct, NDPI_LOG_DBG(ndpi_struct, "search Hangout\n"); if((packet->payload_packet_len > 24) && is_google_flow(ndpi_struct, flow)) { + int matched_src = 0; if( - ((packet->udp != NULL) && (isHangoutUDPPort(ntohs(packet->udp->source)) + ((packet->udp != NULL) && (matched_src = isHangoutUDPPort(ntohs(packet->udp->source)) || isHangoutUDPPort(ntohs(packet->udp->dest)))) || ((packet->tcp != NULL) && (isHangoutTCPPort(ntohs(packet->tcp->source)) @@ -101,7 +102,7 @@ void ndpi_search_hangout(struct ndpi_detection_module_struct *ndpi_struct, ndpi_struct->stun_cache = ndpi_lru_cache_init(1024); if(ndpi_struct->stun_cache && flow->packet.iph && flow->packet.udp) { - u_int32_t key = get_stun_lru_key(flow); + u_int32_t key = get_stun_lru_key(flow, !matched_src); #ifdef DEBUG_LRU printf("[LRU] ADDING %u / %u.%u\n", key, NDPI_PROTOCOL_STUN, NDPI_PROTOCOL_HANGOUT_DUO); diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index 90d816c4a..b1d3d2c5e 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -97,12 +97,6 @@ union ja3_info { #define TLS_THRESHOLD 34387200 /* Threshold for certificate validity */ #define TLS_LIMIT_DATE 1598918400 /* From 01/09/2020 TLS certificates lifespan is limited to 13 months */ -/* skype.c */ -extern u_int8_t is_skype_flow(struct ndpi_detection_module_struct *ndpi_struct, - struct ndpi_flow_struct *flow); - -/* stun.c */ -extern u_int32_t get_stun_lru_key(struct ndpi_flow_struct *flow, u_int8_t rev); static void ndpi_int_tls_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int32_t protocol); |