aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2023-06-22 16:04:14 +0200
committerLuca Deri <deri@ntop.org>2023-06-22 16:04:14 +0200
commitcdc0bb8c6143e416bf6d6ec0efae74d4726dee94 (patch)
treeed592687b039fa8472c4153913685ca01b41e34c /src/lib/protocols
parent167888828470d26a10252d67b62117f770341a5f (diff)
Compilation fix
Diffstat (limited to 'src/lib/protocols')
-rw-r--r--src/lib/protocols/tls.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c
index 10c6fb6f0..e1b85db15 100644
--- a/src/lib/protocols/tls.c
+++ b/src/lib/protocols/tls.c
@@ -1121,10 +1121,15 @@ static int ndpi_search_tls_tcp(struct ndpi_detection_module_struct *ndpi_struct,
flow->tls_quic.certificate_processed = 1;
if(flow->tls_quic.certificate_processed) {
- if(flow->l4.tcp.tls.num_tls_blocks < ndpi_struct->num_tls_blocks_to_follow)
- flow->l4.tcp.tls.tls_application_blocks_len[flow->l4.tcp.tls.num_tls_blocks++] =
- (packet->packet_direction == 0) ? (len-5) : (-(int16_t)(len - 5));
+ if(flow->l4.tcp.tls.num_tls_blocks < ndpi_struct->num_tls_blocks_to_follow) {
+ int16_t blen = len-5;
+ /* Use positive values for c->s e negative for s->c */
+ if(packet->packet_direction != 0) blen = -blen;
+
+ flow->l4.tcp.tls.tls_application_blocks_len[flow->l4.tcp.tls.num_tls_blocks++] = blen;
+ }
+
#ifdef DEBUG_TLS_BLOCKS
printf("*** [TLS Block] [len: %u][num_tls_blocks: %u/%u]\n",
len-5, flow->l4.tcp.tls.num_tls_blocks, ndpi_struct->num_tls_blocks_to_follow);