Make some protocols more "big-endian" friendly (#1402)

See #1312
This commit is contained in:
Ivan Nardi
2022-01-29 09:18:32 +01:00
committed by GitHub
parent 86b97ffb73
commit 0c70411b1b
7 changed files with 33 additions and 30 deletions
+1 -1
View File
@@ -978,7 +978,7 @@ static int ndpi_search_tls_tcp(struct ndpi_detection_module_struct *ndpi_struct,
} else if(len > 5 /* Minimum block size */) {
/* Process element as a whole */
if(content_type == 0x17 /* Application Data */) {
u_int32_t block_len = ntohs((flow->l4.tcp.tls.message.buffer[3] << 16) + (flow->l4.tcp.tls.message.buffer[4] << 8));
u_int32_t block_len = (flow->l4.tcp.tls.message.buffer[3] << 8) + (flow->l4.tcp.tls.message.buffer[4]);
/* Let's do a quick check to make sure this really looks like TLS */
if(block_len < 16384 /* Max TLS block size */)