aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-12-04 16:14:27 +0100
committerGitHub <noreply@github.com>2024-12-04 16:14:27 +0100
commit83ce341796197822e2cde8576a8290c8f87a726a (patch)
tree648aeb98727ddea2f58d95c7ce2091462e995a24 /src/lib/protocols
parentd31b35d012f239784ffe854a93a46d8d97a6b6c5 (diff)
signal: improve detection of chats and calls (#2637)
Diffstat (limited to 'src/lib/protocols')
-rw-r--r--src/lib/protocols/stun.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index 3747d76d0..0ead2a0ea 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -485,6 +485,14 @@ int is_stun(struct ndpi_detection_module_struct *ndpi_struct,
break;
}
+ /* See https://support.signal.org/hc/en-us/articles/360007320291-Firewall-and-Internet-settings.
+ Since the check is quite weak, give time to other applications to kick in */
+ if(flow->packet_counter > 4 && !flow->stun.is_turn &&
+ !is_subclassification_real(flow) &&
+ (ntohs(flow->c_port) == 10000 || ntohs(flow->s_port) == 10000)) {
+ *app_proto = NDPI_PROTOCOL_SIGNAL_VOIP;
+ }
+
off = STUN_HDR_LEN;
while(off + 4 < payload_length) {
u_int16_t attribute = ntohs(*((u_int16_t *)&payload[off]));