From: "flichtenheld (Code Review)"
Date: Tue, 10 Mar 2026 13:21:27 +0000
In-Reply-To:
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net, gert@...1296...
Message-ID:
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="qFwbUgEwtCQ="; 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
--qFwbUgEwtCQ=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: flichtenheld, plaisthos.
Hello cron2, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1524?usp=3Demail
to look at the new patch set (#4).
The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied=
now.
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/4
diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c
index c2b6268..70889dc 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 @@
=20
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: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ibc7a6d8c61b9e584bf5d2d13fb5072b7a28fc53b
Gerrit-Change-Number: 1524
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: cron2
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
Gerrit-Attention: flichtenheld
--qFwbUgEwtCQ=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is cur=
rently required from: flichtenheld, plaisthos.
flichtenheld uploaded patch set #4 to this change.
<=
p>View C=
hange
The change is no longer submittable: checks~ChecksSubmitRul=
e is unsatisfied now.
tls_crypt: Avoid a sign-compare warn=
ing
We already checked that this isn't negative
so just use a=
cast.
Change-Id: Ibc7a6d8c61b9e584bf5d2d13fb5072b7a28fc53b
Signe=
d-off-by: Frank Lichtenheld <frank@...2641...>
---
M src/openvp=
n/tls_crypt.c
1 file changed, 1 insertion(+), 10 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/chang=
es/24/1524/4
diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls=
_crypt.c
index c2b6268..70889dc 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 b=
uffer *dst, struct crypto_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_METADA=
TA_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)=
;
}
-<=
/span>
-#if defined(__GNUC__) =
|| defined(__clang__)
-=
#pragma GCC diagnostic pop
-#endif
To view, visit change 1524. To =
unsubscribe, or for help writing mail filters, visit settings.
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ibc7a6d8c61b9e584bf5d2d13fb5=
072b7a28fc53b
Gerrit-Change-Number: 1524
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <frank@...2723...=
.>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...=
.1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...=
ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...=
..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...=
41...>
=
--qFwbUgEwtCQ=--