aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2024-10-11 19:23:29 +0200
committerLuca Deri <deri@ntop.org>2024-10-11 19:24:06 +0200
commitfaaa5c5799440117f7a9cc78499433396dba7eb3 (patch)
treef57d84662d3e1fb76f108dae21819cb59ef1cead /example/reader_util.c
parent3e74c95d19093d27431e33c072adaab6ca653e78 (diff)
Added support for printing JA4r when enabled
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index 8ed32cad4..702ff4dc7 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -549,6 +549,11 @@ static void ndpi_free_flow_tls_data(struct ndpi_flow_info *flow) {
ndpi_free(flow->ssh_tls.encrypted_sni.esni);
flow->ssh_tls.encrypted_sni.esni = NULL;
}
+
+ if(flow->ssh_tls.ja4_client_raw) {
+ ndpi_free(flow->ssh_tls.ja4_client_raw);
+ flow->ssh_tls.ja4_client_raw = NULL;
+ }
}
/* ***************************************************** */
@@ -1353,7 +1358,11 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
flow->ndpi_flow->protos.tls_quic.ja3_client);
ndpi_snprintf(flow->ssh_tls.ja4_client, sizeof(flow->ssh_tls.ja4_client), "%s",
flow->ndpi_flow->protos.tls_quic.ja4_client);
- ndpi_snprintf(flow->ssh_tls.ja3_server, sizeof(flow->ssh_tls.ja3_server), "%s",
+
+ if(flow->ndpi_flow->protos.tls_quic.ja4_client_raw)
+ flow->ssh_tls.ja4_client_raw = strdup(flow->ndpi_flow->protos.tls_quic.ja4_client_raw);
+
+ ndpi_snprintf(flow->ssh_tls.ja3_server, sizeof(flow->ssh_tls.ja3_server), "%s",
flow->ndpi_flow->protos.tls_quic.ja3_server);
flow->ssh_tls.server_unsafe_cipher = flow->ndpi_flow->protos.tls_quic.server_unsafe_cipher;
flow->ssh_tls.server_cipher = flow->ndpi_flow->protos.tls_quic.server_cipher;