aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-05-07 18:44:51 +0200
committerLuca Deri <deri@ntop.org>2020-05-07 18:44:51 +0200
commit4a09b4efa053a26e187119a540da4b41dd8a24d8 (patch)
tree71cf15d44e184b3a4f21e512465dbd01abdd2c23 /example/reader_util.c
parentfd646bd05ffee4f0da9eaf55ad9e581770ecb099 (diff)
Added TLS issuerDN and subjectDN
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index 3c1af8397..142e0ebe8 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -479,6 +479,16 @@ void ndpi_free_flow_tls_data(struct ndpi_flow_info *flow) {
ndpi_free(flow->ssh_tls.tls_supported_versions);
flow->ssh_tls.tls_supported_versions = NULL;
}
+
+ if(flow->ssh_tls.tls_issuerDN) {
+ ndpi_free(flow->ssh_tls.tls_issuerDN);
+ flow->ssh_tls.tls_issuerDN = NULL;
+ }
+
+ if(flow->ssh_tls.tls_subjectDN) {
+ ndpi_free(flow->ssh_tls.tls_subjectDN);
+ flow->ssh_tls.tls_subjectDN = NULL;
+ }
}
/* ***************************************************** */
@@ -1084,8 +1094,6 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
if(flow->ndpi_flow->protos.stun_ssl.ssl.server_names_len > 0)
flow->ssh_tls.server_names = ndpi_strdup(flow->ndpi_flow->protos.stun_ssl.ssl.server_names);
- snprintf(flow->ssh_tls.server_organization, sizeof(flow->ssh_tls.server_organization), "%s",
- flow->ndpi_flow->protos.stun_ssl.ssl.server_organization);
flow->ssh_tls.notBefore = flow->ndpi_flow->protos.stun_ssl.ssl.notBefore;
flow->ssh_tls.notAfter = flow->ndpi_flow->protos.stun_ssl.ssl.notAfter;
snprintf(flow->ssh_tls.ja3_client, sizeof(flow->ssh_tls.ja3_client), "%s",
@@ -1106,6 +1114,12 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
correct_csv_data_field(flow->ssh_tls.tls_alpn);
}
+ if(flow->ndpi_flow->protos.stun_ssl.ssl.issuerDN)
+ flow->ssh_tls.tls_issuerDN = strdup(flow->ndpi_flow->protos.stun_ssl.ssl.issuerDN);
+
+ if(flow->ndpi_flow->protos.stun_ssl.ssl.subjectDN)
+ flow->ssh_tls.tls_subjectDN = strdup(flow->ndpi_flow->protos.stun_ssl.ssl.subjectDN);
+
if(flow->ssh_tls.tls_supported_versions) {
if((flow->ssh_tls.tls_supported_versions = ndpi_strdup(flow->ndpi_flow->protos.stun_ssl.ssl.tls_supported_versions)) != NULL)
correct_csv_data_field(flow->ssh_tls.tls_supported_versions);