Added ndpi_set_detection_preferences() APi call

This commit is contained in:
Luca Deri
2018-05-14 21:40:27 +02:00
parent 2d486aeed8
commit 1076455c01
15 changed files with 173 additions and 89 deletions
+10 -6
View File
@@ -225,9 +225,11 @@ int getSSLcertificate(struct ndpi_detection_module_struct *ndpi_struct,
}
if(num_dots >= 2) {
stripCertificateTrailer(buffer, buffer_len);
snprintf(flow->protos.ssl.server_certificate,
sizeof(flow->protos.ssl.server_certificate), "%s", buffer);
if(!ndpi_struct->disable_metadata_export) {
stripCertificateTrailer(buffer, buffer_len);
snprintf(flow->protos.ssl.server_certificate,
sizeof(flow->protos.ssl.server_certificate), "%s", buffer);
}
return(1 /* Server Certificate */);
}
}
@@ -289,9 +291,11 @@ int getSSLcertificate(struct ndpi_detection_module_struct *ndpi_struct,
buffer[len] = '\0';
stripCertificateTrailer(buffer, buffer_len);
snprintf(flow->protos.ssl.client_certificate,
sizeof(flow->protos.ssl.client_certificate), "%s", buffer);
if(!ndpi_struct->disable_metadata_export) {
snprintf(flow->protos.ssl.client_certificate,
sizeof(flow->protos.ssl.client_certificate), "%s", buffer);
}
/* We're happy now */
return(2 /* Client Certificate */);
}