From 3f01d1270bbc8115ec6c37577263833c4e196a89 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Wed, 21 Dec 2022 12:32:28 +0200 Subject: [PATCH] lib-ssl-iostream: Use unsigned constants in JA3 code Avoids promotion to signed integer. Fixes compiler warning 'comparison of integer expressions of different signedness' Forgotten in 3ca8852ec531b83c86c30b890b7f0200cf86105a --- src/lib-ssl-iostream/iostream-openssl-context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib-ssl-iostream/iostream-openssl-context.c b/src/lib-ssl-iostream/iostream-openssl-context.c index 30b19d1290..1ded652fa6 100644 --- a/src/lib-ssl-iostream/iostream-openssl-context.c +++ b/src/lib-ssl-iostream/iostream-openssl-context.c @@ -500,7 +500,7 @@ static int ssl_clienthello_callback(SSL *ssl, int *al ATTR_UNUSED, extlen > 0) { bool first = TRUE; unsigned short veclen = be16_to_cpu_unaligned(ext); - if (veclen+2 == extlen) { + if (veclen+2U == extlen) { for (size_t i = 2; i < extlen; i+=2) { uint16_t group = be16_to_cpu_unaligned(&ext[i]); if (ssl_ja3_is_ext_greased(group)) @@ -518,7 +518,7 @@ static int ssl_clienthello_callback(SSL *ssl, int *al ATTR_UNUSED, /* Process extension 11 - ec point formats */ ext = NULL; if (SSL_client_hello_get0_ext(ssl, 11, &ext, &extlen) == 1 && - extlen > 0 && extlen == ext[0]+1) { + extlen > 0 && extlen == ext[0]+1U) { for (size_t i = 1; i < extlen; i++) { if (i > 1) str_append_c(ja3, '-'); -- 2.47.3