Ivan Nardi
a8ffcd8bb0
Rework how hostname/SNI info is saved ( #1330 )
...
Looking at `struct ndpi_flow_struct` the two bigger fields are
`host_server_name[240]` (mainly for HTTP hostnames and DNS domains) and
`protos.tls_quic.client_requested_server_name[256]`
(for TLS/QUIC SNIs).
This commit aims to reduce `struct ndpi_flow_struct` size, according to
two simple observations:
1) maximum one of these two fields is used for each flow. So it seems safe
to merge them;
2) even if hostnames/SNIs might be very long, in practice they are rarely
longer than a fews tens of bytes. So, using a (single) large buffer is a
waste of memory for all kinds of flows. If we need to truncate the name,
we keep the *last* characters, easing domain matching.
Analyzing some real traffic, it seems safe to assume that the vast
majority of hostnames/SNIs is shorter than 80 bytes.
Hostnames/SNIs are always converted to lowercase.
Attention was given so as to be sure that unit-tests outputs are not
affected by this change.
Because of a bug, TLS/QUIC SNI were always truncated to 64 bytes (the
*first* 64 ones): as a consequence, there were some "Suspicious DGA
domain name" and "TLS Certificate Mismatch" false positives.
2021-11-24 10:46:48 +01:00
..
2021-11-15 16:20:57 +01:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-11-15 16:20:57 +01:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-11-04 00:20:45 +01:00
2021-10-16 11:57:32 +02:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2020-03-23 10:06:16 +01:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-14 22:18:34 +02:00
2021-08-07 17:38:33 +02:00
2021-11-17 22:41:35 +01:00
2021-10-16 11:57:32 +02:00
2021-11-17 22:41:35 +01:00
2021-09-19 17:29:22 +02:00
2021-09-09 22:47:58 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-11-15 16:20:57 +01:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 12:03:16 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-11-24 10:46:48 +01:00
2021-10-16 12:03:16 +02:00
2021-10-16 12:03:16 +02:00
2021-10-26 21:34:01 +02:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-11-04 00:20:45 +01:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-16 12:03:16 +02:00
2021-08-07 17:38:33 +02:00
2021-11-04 00:20:45 +01:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-10-14 22:18:34 +02:00
2021-09-21 20:53:04 +02:00
2021-10-16 11:57:32 +02:00
2021-11-24 10:46:48 +01:00
2021-10-16 12:03:16 +02:00
2021-10-16 11:57:32 +02:00
2021-04-18 21:37:51 +02:00
2021-10-27 23:04:29 +02:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 12:03:16 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 12:03:16 +02:00
2021-08-07 17:38:33 +02:00
2021-09-10 22:00:04 +02:00
2021-10-25 15:04:04 +02:00
2021-11-04 00:20:45 +01:00
2021-10-16 11:57:32 +02:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-11-11 11:55:56 +01:00
2021-11-11 11:55:56 +01:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-26 21:34:01 +02:00
2021-10-25 15:04:04 +02:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-11-02 12:08:20 +01:00
2021-11-04 00:20:45 +01:00
2021-11-04 00:20:45 +01:00
2021-11-15 16:20:57 +01:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-09-17 12:20:19 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 12:03:16 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-16 11:57:32 +02:00
2021-10-16 12:03:16 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-11-04 00:20:45 +01:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-11-04 00:20:45 +01:00
2021-08-07 17:38:33 +02:00
2021-09-13 18:25:04 +02:00
2021-09-13 18:25:04 +02:00
2021-08-07 17:38:33 +02:00
2021-11-04 00:20:45 +01:00
2021-11-11 12:36:55 +01:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-11-11 11:55:56 +01:00
2021-10-16 12:03:16 +02:00
2021-11-04 00:20:45 +01:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-11-23 10:57:13 +01:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-11-04 00:20:45 +01:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-11-24 10:46:48 +01:00
2021-10-16 11:57:32 +02:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-16 12:03:16 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-11-11 11:55:56 +01:00
2021-11-11 11:55:56 +01:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-16 12:03:16 +02:00
2021-11-04 00:20:45 +01:00
2021-11-15 16:20:57 +01:00
2021-08-07 17:38:33 +02:00
2021-11-15 16:20:57 +01:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-10-22 14:57:49 +02:00
2021-08-07 17:38:33 +02:00
2021-11-04 00:20:45 +01:00
2021-10-25 15:04:04 +02:00
2021-10-27 09:23:07 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-11-04 00:20:45 +01:00
2021-10-16 11:57:32 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-27 09:23:07 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-11-04 00:20:45 +01:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-11-04 00:20:45 +01:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-10-25 15:04:04 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-08-07 17:38:33 +02:00
2021-10-16 11:57:32 +02:00
2021-11-15 16:20:57 +01:00