diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-08-05 15:15:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 15:15:45 +0200 |
commit | 1d4e27c4739f74ccef19fde7e6008d725ea93a69 (patch) | |
tree | da0d6d7c177488752834482e61c6d802d3d79f82 /src/lib/protocols/tls.c | |
parent | c0732eda45884de91e0c221e9dd23eeec364bf68 (diff) |
Further simplification of `ndpi_process_extra_packet()` (#1698)
See 95e16872.
After c0732eda, we can safely remove the protocol list from
`ndpi_process_extra_packet()`.
The field `flow->check_extra_packets` is redundant; remove it.
Diffstat (limited to 'src/lib/protocols/tls.c')
-rw-r--r-- | src/lib/protocols/tls.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index 6821064f3..53245a21e 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -1094,7 +1094,6 @@ static int ndpi_search_tls_tcp(struct ndpi_detection_module_struct *ndpi_struct, #ifdef DEBUG_TLS_BLOCKS printf("*** [TLS Block] No more blocks\n"); #endif - flow->check_extra_packets = 0; flow->extra_packets_func = NULL; return(0); /* That's all */ } else @@ -1205,7 +1204,6 @@ static int ndpi_search_tls_udp(struct ndpi_detection_module_struct *ndpi_struct, if(no_dtls || change_cipher_found || flow->l4.tcp.tls.certificate_processed) { NDPI_EXCLUDE_PROTO_EXT(ndpi_struct, flow, NDPI_PROTOCOL_DTLS); - flow->check_extra_packets = 0; flow->extra_packets_func = NULL; return(0); /* That's all */ } else { @@ -1219,8 +1217,6 @@ static void tlsInitExtraPacketProcessing(struct ndpi_detection_module_struct *nd struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &ndpi_struct->packet; - flow->check_extra_packets = 1; - /* At most 12 packets should almost always be enough to find the server certificate if it's there */ flow->max_extra_packets_to_check = 12 + (ndpi_struct->num_tls_blocks_to_follow*4); flow->extra_packets_func = (packet->udp != NULL) ? ndpi_search_tls_udp : ndpi_search_tls_tcp; @@ -1277,7 +1273,7 @@ static void ndpi_int_tls_add_connection(struct ndpi_detection_module_struct *ndp if((flow->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) || (flow->detected_protocol_stack[1] != NDPI_PROTOCOL_UNKNOWN)) { - if(!flow->check_extra_packets) + if(!flow->extra_packets_func) tlsInitExtraPacketProcessing(ndpi_struct, flow); return; } |