Add fingerprint_set flag
This commit is contained in:
@@ -646,8 +646,8 @@ struct ndpi_flow_tcp_struct {
|
|||||||
void* srv_cert_fingerprint_ctx; /* SHA-1 */
|
void* srv_cert_fingerprint_ctx; /* SHA-1 */
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_TLS */
|
/* NDPI_PROTOCOL_TLS */
|
||||||
u_int8_t hello_processed:1, certificate_processed:1, subprotocol_detected:1, _pad:5;
|
u_int8_t hello_processed:1, certificate_processed:1, subprotocol_detected:1,
|
||||||
int16_t fingerprint_len; /* Need to be signed */
|
fingerprint_set:1, _pad:4;
|
||||||
u_int8_t sha1_certificate_fingerprint[20];
|
u_int8_t sha1_certificate_fingerprint[20];
|
||||||
} tls;
|
} tls;
|
||||||
|
|
||||||
|
|||||||
@@ -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 = newstr;
|
||||||
flow->protos.stun_ssl.ssl.server_names[flow->protos.stun_ssl.ssl.server_names_len] = ',';
|
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],
|
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[newstr_len] = '\0';
|
||||||
flow->protos.stun_ssl.ssl.server_names_len = newstr_len;
|
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);
|
certificate_len);
|
||||||
|
|
||||||
SHA1Final(flow->l4.tcp.tls.sha1_certificate_fingerprint, flow->l4.tcp.tls.srv_cert_fingerprint_ctx);
|
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
|
#ifdef DEBUG_TLS
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user