diff options
author | Toni <matzeton@googlemail.com> | 2022-07-06 12:40:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-06 12:40:25 +0200 |
commit | 175f863665ce9850398a415fc35ec4ee848b096f (patch) | |
tree | 49b5c7b3b737f3a0edd378e6e9a14a36199c74bb /src/lib/protocols/tls.c | |
parent | c019946f601bf3b55f64f78841a0d696e6c0bfc5 (diff) |
Label SMTP w/ STARTTLS as SMTPS *and* dissect TLS clho. (#1639)
* Label SMTP w/ STARTTLS as SMTPS *and* dissect TLS clho.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
* Revert "SMTP with STARTTLS is now identified as SMTPS"
This reverts commit 52d987b603f49d996b4060f43265d1cf43c3c482.
* Revert "Compilation fix"
This reverts commit c019946f601bf3b55f64f78841a0d696e6c0bfc5.
* Sync unit tests.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/protocols/tls.c')
-rw-r--r-- | src/lib/protocols/tls.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index 5cd74c0df..69bec44f5 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -855,10 +855,7 @@ int processTLSBlock(struct ndpi_detection_module_struct *ndpi_struct, case 0x02: /* Server Hello */ processClientServerHello(ndpi_struct, flow, 0); flow->protos.tls_quic.hello_processed = 1; - - ndpi_int_tls_add_connection(ndpi_struct, flow, - /* Check if this is a SMTP connection with STARTTLS or TLS */ - (flow->l4.tcp.smtp_command_bitmask & SMTP_BIT_STARTTLS) ? NDPI_PROTOCOL_MAIL_SMTPS : NDPI_PROTOCOL_TLS); + ndpi_int_tls_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TLS); #ifdef DEBUG_TLS printf("*** TLS [version: %02X][%s Hello]\n", @@ -1246,8 +1243,7 @@ static void tlsCheckUncommonALPN(struct ndpi_detection_module_struct *ndpi_struc static void ndpi_int_tls_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int32_t protocol) { struct ndpi_packet_struct *packet = &ndpi_struct->packet; - u_int16_t upper_detected_protocol; - + #if DEBUG_TLS printf("[TLS] %s()\n", __FUNCTION__); #endif @@ -1262,17 +1258,12 @@ static void ndpi_int_tls_add_connection(struct ndpi_detection_module_struct *ndp return; } - if(protocol != NDPI_PROTOCOL_TLS) { - if(flow->l4.tcp.smtp_command_bitmask & SMTP_BIT_STARTTLS) - upper_detected_protocol = flow->detected_protocol_stack[0]; - else - upper_detected_protocol = protocol; - } else { + if(protocol != NDPI_PROTOCOL_TLS) + ; + else protocol = ndpi_tls_refine_master_protocol(ndpi_struct, flow, protocol); - upper_detected_protocol = protocol; - } - - ndpi_set_detected_protocol(ndpi_struct, flow, upper_detected_protocol, protocol, NDPI_CONFIDENCE_DPI); + + ndpi_set_detected_protocol(ndpi_struct, flow, protocol, protocol, NDPI_CONFIDENCE_DPI); tlsInitExtraPacketProcessing(ndpi_struct, flow); } |