From: "flichtenheld (Code Review)" Date: Fri, 13 Feb 2026 18:44:53 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <08e11a916819217ce30e51f3b1c4b70e3e6f215b-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="TtruBdqRc0o="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: tls_crypt: Avoid a sign-compare warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --TtruBdqRc0o= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1524?usp=3Demail to review the following change. Change subject: tls_crypt: Avoid a sign-compare warning ...................................................................... tls_crypt: Avoid a sign-compare warning We already checked that this isn't negative so just use a cast. Change-Id: Ibc7a6d8c61b9e584bf5d2d13fb5072b7a28fc53b Signed-off-by: Frank Lichtenheld --- M src/openvpn/tls_crypt.c 1 file changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/1524/1 diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c index 44aaad9..92acbc0 100644 --- a/src/openvpn/tls_crypt.c +++ b/src/openvpn/tls_crypt.c @@ -206,11 +206,6 @@ return false; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - bool tls_crypt_unwrap(const struct buffer *src, struct buffer *dst, struct cryp= to_options *opt) { @@ -728,7 +723,7 @@ msg(M_FATAL, "ERROR: failed to base64 decode provided metadata= "); goto cleanup; } - if (decoded_len > TLS_CRYPT_V2_MAX_METADATA_LEN - 1) + if ((unsigned int)decoded_len > TLS_CRYPT_V2_MAX_METADATA_LEN - 1) { msg(M_FATAL, "ERROR: metadata too long (%d bytes, max %u bytes= )", decoded_len, TLS_CRYPT_V2_MAX_METADATA_LEN - 1); @@ -801,7 +796,3 @@ gc_free(&gc); } - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1524?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ibc7a6d8c61b9e584bf5d2d13fb5072b7a28fc53b Gerrit-Change-Number: 1524 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --TtruBdqRc0o= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

tls_crypt: Avoid a sign-compare warning
=
We already checked that this isn't negative
so just use a cast.<= br>
Change-Id: Ibc7a6d8c61b9e584bf5d2d13fb5072b7a28fc53b
Signed-off-b= y: Frank Lichtenheld <frank@...2641...>
---
M src/openvpn/tls_c= rypt.c
1 file changed, 1 insertion(+), 10 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/1= 524/1
diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.=
c
index 44aaad9..92acbc0 100644
--- a/src/o= penvpn/tls_crypt.c
+++ b/src/openvpn/tls_crypt.c
= @@ -206,11 +206,6 @@
return false;
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign= -compare"
-#endif<= /span>
-
bool=
tls_crypt_unwrap(const struct buffer *src, struct buffer = *dst, struct crypto_options *opt)
{
@@ -72= 8,7 +723,7 @@
msg(M_FATAL, "ERROR: failed= to base64 decode provided metadata");
go= to cleanup;
}
- if (decoded_len > TLS_CRYPT_V2_MAX_METADATA_LEN= - 1)
+ if ((u= nsigned int)decoded_len > TLS_CRYPT_V2_MAX_METADATA_LEN - 1)
<= span> {

msg(M_FATAL, "ERROR: meta= data too long (%d bytes, max %u bytes)", decoded_len,
= TLS_CRYPT_V2_MAX_METADATA_LEN - 1);
@@ -80= 1,7 +796,3 @@

gc_free(&gc);
}
-=
-#if defined(__GNUC__) || def= ined(__clang__)
-#pragm= a GCC diagnostic pop
-#= endif

To view, visit change 1524. To unsubs= cribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ibc7a6d8c61b9e584bf5d2d13fb5= 072b7a28fc53b
Gerrit-Change-Number: 1524
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --TtruBdqRc0o=--