Improve normalization of flow->host_server_name (#2310)
Follow-up of 4543385d10
Remove trailing spaces for any HTTP header (we already remove leading
spaces)
We want:
* a "normalized" string in `flow->host_server_name`, but
* to parse the original string for flow risk checking
`ndpi_hostname_sni_set()` is a private function, so there is no need to
export its flags.
This commit is contained in:
@@ -2258,7 +2258,7 @@ int processClientServerHello(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
#ifdef DEBUG_TLS
|
||||
printf("[TLS] SNI: [%s]\n", sni);
|
||||
#endif
|
||||
if(ndpi_is_valid_hostname(sni, sni_len) == 0) {
|
||||
if(ndpi_is_valid_hostname((char *)&packet->payload[offset+extension_offset+5], len) == 0) {
|
||||
ndpi_set_risk(ndpi_struct, flow, NDPI_INVALID_CHARACTERS, sni);
|
||||
|
||||
/* This looks like an attack */
|
||||
|
||||
Reference in New Issue
Block a user