Skip to content

Commit b1f2f44

Browse files
authored
Fix export of TLS info. See cb7bd38 (#3162)
1 parent 68c7159 commit b1f2f44

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/include/ndpi_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,8 @@ extern "C" {
20052005
u_int8_t ndpi_is_protocol_detected(ndpi_protocol proto);
20062006
void ndpi_serialize_tls_blocks(struct ndpi_detection_module_struct *ndpi_struct,
20072007
ndpi_serializer *serializer,
2008-
struct ndpi_flow_struct *flow);
2008+
struct ndpi_flow_struct *flow,
2009+
bool is_tls_proto);
20092010
void ndpi_serialize_risk(ndpi_serializer *serializer, ndpi_risk risk);
20102011
void ndpi_serialize_risk_score(ndpi_serializer *serializer, ndpi_risk_enum risk);
20112012
void ndpi_serialize_confidence(ndpi_serializer *serializer, ndpi_confidence_t confidence);

src/lib/ndpi_utils.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,8 +1240,10 @@ void ndpi_serialize_proto(struct ndpi_detection_module_struct *ndpi_struct,
12401240

12411241
void ndpi_serialize_tls_blocks(struct ndpi_detection_module_struct *ndpi_struct,
12421242
ndpi_serializer *serializer,
1243-
struct ndpi_flow_struct *flow) {
1244-
if((ndpi_struct->cfg.tls_max_num_blocks_to_analyze > 0)
1243+
struct ndpi_flow_struct *flow,
1244+
bool is_tls_proto) {
1245+
if(is_tls_proto
1246+
&& (ndpi_struct->cfg.tls_max_num_blocks_to_analyze > 0)
12451247
&& (flow->l4.tcp.tls.tls_blocks != NULL)
12461248
&& (flow->l4.tcp.tls.num_tls_blocks > 0)) {
12471249
u_int16_t i, idx = 0;
@@ -1430,8 +1432,6 @@ static void ndpi_tls2json(struct ndpi_detection_module_struct *ndpi_struct, ndpi
14301432
u_int8_t unknown_tls_version;
14311433
char version[16], unknown_cipher[8];
14321434

1433-
__ndpi_unused_param(is_tls_proto);
1434-
14351435
ndpi_ssl_version2str(version, sizeof(version), flow->protos.tls_quic.ssl_version, &unknown_tls_version);
14361436

14371437
if(flow->protos.tls_quic.notBefore)
@@ -1491,7 +1491,7 @@ static void ndpi_tls2json(struct ndpi_detection_module_struct *ndpi_struct, ndpi
14911491
ndpi_serialize_string_string(serializer, "fingerprint", buf);
14921492
}
14931493

1494-
ndpi_serialize_tls_blocks(ndpi_struct, serializer, flow);
1494+
ndpi_serialize_tls_blocks(ndpi_struct, serializer, flow, is_tls_proto);
14951495

14961496
ndpi_serialize_end_of_block(serializer);
14971497
}

0 commit comments

Comments
 (0)