]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Use unsigned constants in JA3 code
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 21 Dec 2022 10:32:28 +0000 (12:32 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 21 Dec 2022 16:49:58 +0000 (16:49 +0000)
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

index 30b19d12902d83ea154c3770644e93b27b67bdc1..1ded652fa67515bcfea0b809c0b575616990c4d4 100644 (file)
@@ -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, '-');