diff options
author | Luca Deri <deri@ntop.org> | 2020-05-10 21:40:35 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-05-10 21:40:35 +0200 |
commit | ae803c8b51dec9e31e99cb37cd64bd968b314669 (patch) | |
tree | 970bcda3c671e73fd6d7b12b621595925bfee4f1 /src/lib/protocols/tls.c | |
parent | e5e69d0f7ab382e3507660fe752027c09e32310e (diff) |
Added detection of self-signed TLS certificates
Diffstat (limited to 'src/lib/protocols/tls.c')
-rw-r--r-- | src/lib/protocols/tls.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index 171d7c489..655d61ed6 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -450,6 +450,11 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi } if(rdn_len) flow->protos.stun_ssl.ssl.subjectDN = strdup(rdnSeqBuf); + + if(flow->protos.stun_ssl.ssl.subjectDN && flow->protos.stun_ssl.ssl.subjectDN + && (!strcmp(flow->protos.stun_ssl.ssl.subjectDN, flow->protos.stun_ssl.ssl.issuerDN))) + NDPI_SET_BIT_16(flow->risk, NDPI_TLS_SELFSIGNED_CERTIFICATE); + #if DEBUG_TLS printf("[TLS] %s() SubjectDN [%s]\n", __FUNCTION__, rdnSeqBuf); #endif |