Added fix for invalid SNI check when SNI is missing

This commit is contained in:
Luca Deri
2020-10-02 21:26:43 +02:00
parent b68a3707f6
commit addc775811
+3 -1
View File
@@ -439,7 +439,9 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi
printf("[TLS] dNSName %s [%s]\n", dNSName, flow->protos.stun_ssl.ssl.client_requested_server_name);
#endif
if(matched_name == 0) {
if((dNSName[0] == '*') && strstr(flow->protos.stun_ssl.ssl.client_requested_server_name, &dNSName[1]))
if(flow->protos.stun_ssl.ssl.client_requested_server_name[0] == '\0')
matched_name = 1; /* No SNI */
else if((dNSName[0] == '*') && strstr(flow->protos.stun_ssl.ssl.client_requested_server_name, &dNSName[1]))
matched_name = 1;
else if(strcmp(flow->protos.stun_ssl.ssl.client_requested_server_name, dNSName) == 0)
matched_name = 1;