From: "flichtenheld (Code Review)" Date: Mon, 6 Oct 2025 16:07:05 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <0b33b268d44cc8ef86e4cc5a5d82e4021b8a94ac-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="j9H6viu75nA="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: crypto: Add more explicit casts for OpenBSD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --j9H6viu75nA= 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/+/1252?usp=3Demail to review the following change. Change subject: crypto: Add more explicit casts for OpenBSD ...................................................................... crypto: Add more explicit casts for OpenBSD The compiler on OpenBSD is a bit more zealous about these strlen's even though these are static values that can be determined at compile time... This was missed in the previous commit ("crypto: Make some casts to int explicit") because we don't use -Werror on OpenBSD, yet. Change-Id: Ia93bd8874e1b578d553720eedc274b974a462483 Signed-off-by: Frank Lichtenheld --- M src/openvpn/crypto.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/52/1252/1 diff --git a/src/openvpn/crypto.c b/src/openvpn/crypto.c index 13635fb..026e874 100644 --- a/src/openvpn/crypto.c +++ b/src/openvpn/crypto.c @@ -1361,8 +1361,8 @@ int state =3D PARSE_INITIAL; /* constants */ - const int hlen =3D strlen(static_key_head); - const int flen =3D strlen(static_key_foot); + const int hlen =3D (int)strlen(static_key_head); + const int flen =3D (int)strlen(static_key_foot); const int onekeylen =3D sizeof(key2->keys[0]); CLEAR(*key2); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1252?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: Ia93bd8874e1b578d553720eedc274b974a462483 Gerrit-Change-Number: 1252 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --j9H6viu75nA= 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

crypto: Add more explicit casts for OpenBSD=


The compiler on OpenBSD is a bit more zealous
about these strlen= 's even though these are
static values that can be determined at
= compile time...

This was missed in the previous commit
("cry= pto: Make some casts to int explicit")
because we don't use -We= rror on OpenBSD, yet.

Change-Id: Ia93bd8874e1b578d553720eedc274b974a= 462483
Signed-off-by: Frank Lichtenheld <frank@...2641...>
---<= br>M src/openvpn/crypto.c
1 file changed, 2 insertions(+), 2 deletions(-= )

git pull ssh://gerrit.openvpn.net:29418/openvp=
n refs/changes/52/1252/1
diff --git a/src/openvpn/crypto.c b/src/op=
envpn/crypto.c
index 13635fb..026e874 100644
--- a/src/openvpn/crypto.c
+++ b/src/openvpn/crypto.c
@@ -1361,8 +1361,8 @@
int state =3D PARSE= _INITIAL;

/* constants */
= - const int hlen =3D strlen(st= atic_key_head);
- co= nst int flen =3D strlen(static_key_foot);
+ const int hlen =3D (int)strlen(static_key_head);<= /span>
+ const int flen = =3D (int)strlen(static_key_foot);
const int onekeylen = =3D sizeof(key2->keys[0]);

CLEAR(= *key2);

To view, visit change 1252. To unsu= bscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia93bd8874e1b578d553720eedc2= 74b974a462483
Gerrit-Change-Number: 1252
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...>
= --j9H6viu75nA=--