Add fingerprint_set flag

This commit is contained in:
emanuele-f
2020-01-02 12:56:25 +01:00
parent 634457615c
commit a58a135758
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -646,8 +646,8 @@ struct ndpi_flow_tcp_struct {
void* srv_cert_fingerprint_ctx; /* SHA-1 */
/* NDPI_PROTOCOL_TLS */
u_int8_t hello_processed:1, certificate_processed:1, subprotocol_detected:1, _pad:5;
int16_t fingerprint_len; /* Need to be signed */
u_int8_t hello_processed:1, certificate_processed:1, subprotocol_detected:1,
fingerprint_set:1, _pad:4;
u_int8_t sha1_certificate_fingerprint[20];
} tls;
+3 -1
View File
@@ -394,7 +394,7 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi
flow->protos.stun_ssl.ssl.server_names = newstr;
flow->protos.stun_ssl.ssl.server_names[flow->protos.stun_ssl.ssl.server_names_len] = ',';
strncpy(&flow->protos.stun_ssl.ssl.server_names[flow->protos.stun_ssl.ssl.server_names_len+1],
dNSName, dNSName_len);
dNSName, dNSName_len-1);
flow->protos.stun_ssl.ssl.server_names[newstr_len] = '\0';
flow->protos.stun_ssl.ssl.server_names_len = newstr_len;
}
@@ -482,6 +482,8 @@ int processCertificate(struct ndpi_detection_module_struct *ndpi_struct,
certificate_len);
SHA1Final(flow->l4.tcp.tls.sha1_certificate_fingerprint, flow->l4.tcp.tls.srv_cert_fingerprint_ctx);
flow->l4.tcp.tls.fingerprint_set = 1;
#ifdef DEBUG_TLS
{