Improved SSL certificate name wildcard handling and risk. #1182 (#1183)

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni
2021-05-11 21:38:26 +02:00
committed by GitHub
parent a5ecdf9df8
commit 5918a6542d
3 changed files with 22 additions and 2 deletions
+14 -2
View File
@@ -497,8 +497,20 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi
if(matched_name == 0) {
if(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name[0] == '\0')
matched_name = 1; /* No SNI */
else if((dNSName[0] == '*') && strstr(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name, &dNSName[1]))
matched_name = 1;
else if (dNSName[0] == '*')
{
char * label = strstr(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name, &dNSName[1]);
if (label != NULL)
{
char * first_dot = strchr(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name, '.');
if (first_dot == NULL || first_dot >= label)
{
matched_name = 1;
}
}
}
else if(strcmp(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name, dNSName) == 0)
matched_name = 1;
}