Normalization of host_server_name (#2299)

* Normalization of host_server_name

The ndpi_hostname_sni_set() function replaces all non-printable
characters with the "?" character and removing whitespace characters
at the end of the line.

* Added conditional hostname normalization.
This commit is contained in:
Vitaly Lavrov
2024-02-05 19:44:45 +01:00
committed by GitHub
parent a4da4467ac
commit 4543385d10
19 changed files with 50 additions and 23 deletions
+2 -2
View File
@@ -63,9 +63,9 @@ static void xiaomi_dissect_metadata(struct ndpi_detection_module_struct *ndpi_st
/* If "domain:port", strip the port */
ptr = ndpi_strnstr((const char *)&payload[offset], ":", len);
if(ptr == NULL)
ndpi_hostname_sni_set(flow, &payload[offset], len);
ndpi_hostname_sni_set(flow, &payload[offset], len, NDPI_HOSTNAME_NORM_ALL);
else
ndpi_hostname_sni_set(flow, &payload[offset], (const u_int8_t *)ptr - &payload[offset]);
ndpi_hostname_sni_set(flow, &payload[offset], (const u_int8_t *)ptr - &payload[offset], NDPI_HOSTNAME_NORM_ALL);
break;
case 0x32: /* Radio access technology (+ APN) */