Hangout: fix usage of STUN function (#1299)
This commit is contained in:
@@ -49,9 +49,6 @@
|
|||||||
#include "third_party/include/ndpi_patricia.h"
|
#include "third_party/include/ndpi_patricia.h"
|
||||||
#include "third_party/include/ndpi_md5.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;
|
static int _ndpi_debug_callbacks = 0;
|
||||||
|
|
||||||
/* #define DGA_DEBUG 1 */
|
/* #define DGA_DEBUG 1 */
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
/* stun.c */
|
/* 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 */
|
/* https://support.google.com/a/answer/1279090?hl=en */
|
||||||
#define HANGOUT_UDP_LOW_PORT 19302
|
#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");
|
NDPI_LOG_DBG(ndpi_struct, "search Hangout\n");
|
||||||
|
|
||||||
if((packet->payload_packet_len > 24) && is_google_flow(ndpi_struct, flow)) {
|
if((packet->payload_packet_len > 24) && is_google_flow(ndpi_struct, flow)) {
|
||||||
|
int matched_src = 0;
|
||||||
if(
|
if(
|
||||||
((packet->udp != NULL) && (isHangoutUDPPort(ntohs(packet->udp->source))
|
((packet->udp != NULL) && (matched_src = isHangoutUDPPort(ntohs(packet->udp->source))
|
||||||
|| isHangoutUDPPort(ntohs(packet->udp->dest))))
|
|| isHangoutUDPPort(ntohs(packet->udp->dest))))
|
||||||
||
|
||
|
||||||
((packet->tcp != NULL) && (isHangoutTCPPort(ntohs(packet->tcp->source))
|
((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);
|
ndpi_struct->stun_cache = ndpi_lru_cache_init(1024);
|
||||||
|
|
||||||
if(ndpi_struct->stun_cache && flow->packet.iph && flow->packet.udp) {
|
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
|
#ifdef DEBUG_LRU
|
||||||
printf("[LRU] ADDING %u / %u.%u\n", key, NDPI_PROTOCOL_STUN, NDPI_PROTOCOL_HANGOUT_DUO);
|
printf("[LRU] ADDING %u / %u.%u\n", key, NDPI_PROTOCOL_STUN, NDPI_PROTOCOL_HANGOUT_DUO);
|
||||||
|
|||||||
@@ -97,12 +97,6 @@ union ja3_info {
|
|||||||
#define TLS_THRESHOLD 34387200 /* Threshold for certificate validity */
|
#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 */
|
#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,
|
static void ndpi_int_tls_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow, u_int32_t protocol);
|
struct ndpi_flow_struct *flow, u_int32_t protocol);
|
||||||
|
|||||||
Reference in New Issue
Block a user