From: "cron2 (Code Review)" Date: Sat, 17 Jan 2026 16:25:39 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <252f8aa7baf84a44ee701cd6cfe65c9bfd042dd3-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="LwFw/N1OWPQ="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: crypto_openssl: Fix various conversion warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --LwFw/N1OWPQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#5) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1446?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: crypto_openssl: Fix various conversion warnings ...................................................................... crypto_openssl: Fix various conversion warnings EVP_CIPHER_CTX_flags is documented to output int in OpenSSL, but is actually unsigned long in OpenSSL 3. In libressl it is correctly documented to output unsigned long. Change-Id: I99bc4692526f9143a913e29b266a1816295dfd51 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1446 Message-Id: <20260116172010.25278-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 311.html Signed-off-by: Gert Doering --- M src/openvpn/crypto_openssl.c 1 file changed, 4 insertions(+), 13 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/46/1446/5 diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index 64882f5..ed39efa 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -896,11 +896,6 @@ return EVP_CIPHER_CTX_mode(ctx); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - bool cipher_ctx_mode_cbc(const cipher_ctx_t *ctx) { @@ -909,7 +904,7 @@ return false; } - int flags =3D EVP_CIPHER_CTX_flags(ctx); + unsigned long flags =3D EVP_CIPHER_CTX_flags(ctx); int mode =3D EVP_CIPHER_CTX_mode(ctx); return mode =3D=3D EVP_CIPH_CBC_MODE @@ -940,7 +935,7 @@ { if (ctx) { - int flags =3D EVP_CIPHER_CTX_flags(ctx); + unsigned long flags =3D EVP_CIPHER_CTX_flags(ctx); if (flags & EVP_CIPH_FLAG_AEAD_CIPHER) { return true; @@ -995,8 +990,8 @@ cipher_ctx_final_check_tag(EVP_CIPHER_CTX *ctx, uint8_t *dst, int *dst_len= , uint8_t *tag, size_t tag_len) { - ASSERT(tag_len < SIZE_MAX); - if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, tag_len, tag)) + ASSERT(tag_len < INT_MAX); + if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, (int)tag_len, tag= )) { return 0; } @@ -1004,10 +999,6 @@ return cipher_ctx_final(ctx, dst, dst_len); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /* * * Generic message digest information functions -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1446?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: I99bc4692526f9143a913e29b266a1816295dfd51 Gerrit-Change-Number: 1446 Gerrit-PatchSet: 5 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --LwFw/N1OWPQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #5 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by cron2

crypto_openssl: Fix various convers=
ion warnings

EVP_CIPHER_CTX_flags is documented to output
int in = OpenSSL, but is actually unsigned long
in OpenSSL 3.
In libressl it i= s correctly documented to output
unsigned long.

Change-Id: I99bc4= 692526f9143a913e29b266a1816295dfd51
Signed-off-by: Frank Lichtenheld <= ;frank@...2641...>
Acked-by: Gert Doering <gert@...1296...>
= Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1446
Message-Id: <= 20260116172010.25278-1-gert@...1296...>
URL: https://www.mail-archive= .com/openvpn-devel@lists.sourceforge.net/msg35311.html
Signed-off-by: Ge= rt Doering <gert@...1296...>
---
M src/openvpn/crypto_openssl.c=
1 file changed, 4 insertions(+), 13 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/46/1446/5=
diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_ope=
nssl.c
index 64882f5..ed39efa 100644
--- a/= src/openvpn/crypto_openssl.c
+++ b/src/openvpn/crypto_opens= sl.c
@@ -896,11 +896,6 @@
return EVP_C= IPHER_CTX_mode(ctx);
}

-#if defined(__GNUC__) || defined(__clan= g__)
-#pragma GCC diagn= ostic push
-#pragma GCC= diagnostic ignored "-Wconversion"
-#endif
-
bool
cipher_ctx_mode_cbc(const c= ipher_ctx_t *ctx)
{
@@ -909,7 +904,7 @@
return false;
}

- int flags =3D E= VP_CIPHER_CTX_flags(ctx);
+ unsigned long flags =3D EVP_CIPHER_CTX_flags(ctx);
int mode =3D EVP_CIPHER_CTX_mode(ctx);

<= span> return mode =3D=3D EVP_CIPH_CBC_MODE
@@ -940,7 +9= 35,7 @@
{
if (ctx)
= {
- int flags= =3D EVP_CIPHER_CTX_flags(ctx);
+ unsigned long flags =3D EVP_CIPHER_CTX_flags(ctx);

if (flags & EVP_CIPH_FLAG_AEAD_CIPHER)
<= span> {
return true;
@= @ -995,8 +990,8 @@
cipher_ctx_final_check_tag(EVP_CIPHER_C= TX *ctx, uint8_t *dst, int *dst_len, uint8_t *tag,
= size_t tag_len)
{
- ASSERT(tag_len < SIZE_MAX);<= br>- if (!EVP_CIPHER_CTX_ctrl(= ctx, EVP_CTRL_AEAD_SET_TAG, tag_len, tag))
+ ASSERT(tag_len < INT_MAX);
+ if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_= CTRL_AEAD_SET_TAG, (int)tag_len, tag))
{
return 0;
}
@@ -1004,10 +9= 99,6 @@
return cipher_ctx_final(ctx, dst, dst_len);
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif

-
/*
* * Generic message digest information functions

To view, visit change 1446. To unsubscribe, or for help writin= g mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I99bc4692526f9143a913e29b266= a1816295dfd51
Gerrit-Change-Number: 1446
Gerrit-PatchSet: 5
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>
= --LwFw/N1OWPQ=--