From a31bd5ac3c6a8542a414a32eb1b61b2d28d3c7a6 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Thu, 21 Jan 2021 19:17:33 +0100 Subject: Cleaned up tls/quic datatypes --- src/lib/protocols/quic.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/lib/protocols/quic.c') diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index dac402de5..655d90aa5 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -1190,12 +1190,12 @@ static void process_tls(struct ndpi_detection_module_struct *ndpi_struct, this way we lose JA3S and negotiated ciphers... Negotiated version is only present in the ServerHello message too, but fortunately, QUIC always uses TLS version 1.3 */ - flow->protos.stun_ssl.ssl.ssl_version = 0x0304; + flow->protos.tls_quic_stun.tls_quic.ssl_version = 0x0304; /* DNS-over-QUIC: ALPN is "doq" or "doq-XXX" (for drafts versions) */ - if(flow->protos.stun_ssl.ssl.alpn && - strncmp(flow->protos.stun_ssl.ssl.alpn, "doq", 3) == 0) { - NDPI_LOG_DBG(ndpi_struct, "Found DOQ (ALPN: [%s])\n", flow->protos.stun_ssl.ssl.alpn); + if(flow->protos.tls_quic_stun.tls_quic.alpn && + strncmp(flow->protos.tls_quic_stun.tls_quic.alpn, "doq", 3) == 0) { + NDPI_LOG_DBG(ndpi_struct, "Found DOQ (ALPN: [%s])\n", flow->protos.tls_quic_stun.tls_quic.alpn); ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_QUIC); } } @@ -1239,22 +1239,22 @@ static void process_chlo(struct ndpi_detection_module_struct *ndpi_struct, #endif if((memcmp(tag, "SNI\0", 4) == 0) && (tag_offset_start + prev_offset + len < crypto_data_len)) { - sni_len = MIN(len, sizeof(flow->protos.stun_ssl.ssl.client_requested_server_name) - 1); - memcpy(flow->protos.stun_ssl.ssl.client_requested_server_name, + sni_len = MIN(len, sizeof(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name) - 1); + memcpy(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name, &crypto_data[tag_offset_start + prev_offset], sni_len); - flow->protos.stun_ssl.ssl.client_requested_server_name[sni_len] = '\0'; + flow->protos.tls_quic_stun.tls_quic.client_requested_server_name[sni_len] = '\0'; NDPI_LOG_DBG2(ndpi_struct, "SNI: [%s]\n", - flow->protos.stun_ssl.ssl.client_requested_server_name); + flow->protos.tls_quic_stun.tls_quic.client_requested_server_name); ndpi_match_host_subprotocol(ndpi_struct, flow, - (char *)flow->protos.stun_ssl.ssl.client_requested_server_name, - strlen((const char*)flow->protos.stun_ssl.ssl.client_requested_server_name), + (char *)flow->protos.tls_quic_stun.tls_quic.client_requested_server_name, + strlen((const char*)flow->protos.tls_quic_stun.tls_quic.client_requested_server_name), &ret_match, NDPI_PROTOCOL_QUIC); flow->l4.tcp.tls.hello_processed = 1; /* Allow matching of custom categories */ ndpi_check_dga_name(ndpi_struct, flow, - flow->protos.stun_ssl.ssl.client_requested_server_name, 1); + flow->protos.tls_quic_stun.tls_quic.client_requested_server_name, 1); sni_found = 1; if (ua_found) @@ -1281,7 +1281,7 @@ static void process_chlo(struct ndpi_detection_module_struct *ndpi_struct, NDPI_LOG_DBG(ndpi_struct, "Something went wrong in tags iteration\n"); /* Add check for missing SNI */ - if(flow->protos.stun_ssl.ssl.client_requested_server_name[0] == '\0') { + if(flow->protos.tls_quic_stun.tls_quic.client_requested_server_name[0] == '\0') { /* This is a bit suspicious */ NDPI_SET_BIT(flow->risk, NDPI_TLS_MISSING_SNI); } -- cgit v1.2.3