From: Aki Tuomi Date: Wed, 21 Dec 2022 10:32:28 +0000 (+0200) Subject: lib-ssl-iostream: Use unsigned constants in JA3 code X-Git-Tag: 2.4.0~3255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f01d1270bbc8115ec6c37577263833c4e196a89;p=thirdparty%2Fdovecot%2Fcore.git 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 --- 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, '-');