diff options
author | Vitaly Lavrov <vel21ripn@gmail.com> | 2021-06-15 09:28:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 11:28:09 +0200 |
commit | be808c30f3f4582009df4c5efccd4f3bb0c6ef1d (patch) | |
tree | f16d861560fecd97d23e5de1826d8fdc9bcd0049 /src/lib/protocols/tls.c | |
parent | 09293fabd9dcb92812641788509a1a766e9320f8 (diff) |
Code review. (#1205)
The common actions required to call the ac_automata_search() function
have been moved to the ndpi_match_string_common function. This made it
possible to simplify the ndpi_match_string, ndpi_match_string_protocol_id,
ndpi_match_string_value, ndpi_match_custom_category, ndpi_match_string_subprotocol,
ndpi_match_bigram, ndpi_match_trigram functions.
Using u_int16_t type for protocol identifiers when working with the
ahocorasick library (changes src/include/ndpi_api.h.in and src/include/ndpi_typedefs.h).
Reworked "finalization" of all AC_AUTOMATA_t structures.
Changing the order of fields in the ndpi_call_function_struct structure
reduces the size of the ndpi_detection_module_struct structure by 10 kB (for x86_64).
Diffstat (limited to 'src/lib/protocols/tls.c')
-rw-r--r-- | src/lib/protocols/tls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index 4b54b47a0..5f15d7f14 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -591,9 +591,9 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi if(flow->detected_protocol_stack[1] == NDPI_PROTOCOL_UNKNOWN) { /* No idea what is happening behind the scenes: let's check the certificate */ - u_int32_t proto_id; + u_int16_t proto_id; int rc = ndpi_match_string_value(ndpi_struct->tls_cert_subject_automa.ac_automa, - rdnSeqBuf, strlen(rdnSeqBuf),&proto_id); + rdnSeqBuf, strlen(rdnSeqBuf), &proto_id); if(rc == 0) { /* Match found */ |