From: "cron2 (Code Review)" Date: Wed, 12 Nov 2025 13:58:59 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <46f001df2054564efee5ff94cb7c34f2a5de0ab1-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Xm6npHJD3dk="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: openssl_compat: Avoid conversion warning for SSL_get_negotiated_group List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --Xm6npHJD3dk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/13= 59?usp=3Demail ) Change subject: openssl_compat: Avoid conversion warning for SSL_get_negoti= ated_group ...................................................................... openssl_compat: Avoid conversion warning for SSL_get_negotiated_group SSL_get_negotiated_group is documented to return int and SSL_group_to_name definitely expects an int. But SSL_get_negotiated_group is actually a macro implemented by SSL_ctrl, which does return a long. So to avoid the conversion warning we need the cast. Change-Id: I31024f93d9d9d0f678fb39d4758a7e870bf00873 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1359 Message-Id: <20251111153230.29865-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 316.html Signed-off-by: Gert Doering --- M src/openvpn/openssl_compat.h 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h index fb3c9b1..b9af132 100644 --- a/src/openvpn/openssl_compat.h +++ b/src/openvpn/openssl_compat.h @@ -194,21 +194,12 @@ LIBRESSL_VERSION_NUMBER > 0x3050400fL) */ #if OPENSSL_VERSION_NUMBER < 0x30200000L && OPENSSL_VERSION_NUMBER >=3D 0x= 30000000L -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static inline const char * SSL_get0_group_name(SSL *s) { - int nid =3D SSL_get_negotiated_group(s); + int nid =3D (int)SSL_get_negotiated_group(s); return SSL_group_to_name(s, nid); } - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif #endif /* Introduced in OpenSSL 3.6.0 */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1359?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I31024f93d9d9d0f678fb39d4758a7e870bf00873 Gerrit-Change-Number: 1359 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --Xm6npHJD3dk= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

openssl_compat: Avoid conversion warning for SSL=
_get_negotiated_group

SSL_get_negotiated_group is documented to retu= rn
int and SSL_group_to_name definitely expects an int.

But SSL_g= et_negotiated_group is actually a macro
implemented by SSL_ctrl, which d= oes return a long.
So to avoid the conversion warning we need the cast.<= br>
Change-Id: I31024f93d9d9d0f678fb39d4758a7e870bf00873
Signed-off-b= y: Frank Lichtenheld <frank@...2641...>
Acked-by: Arne Schwabe <= ;arne-openvpn@...1227...>
Gerrit URL: https://gerrit.openvpn.net/c/op= envpn/+/1359
Message-Id: <20251111153230.29865-1-gert@...1296...><= br>URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/ms= g34316.html
Signed-off-by: Gert Doering <gert@...1296...>
---M src/openvpn/openssl_compat.h
1 file changed, 1 insertion(+), 10 dele= tions(-)

diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h=

index fb3c9b1..b9af132 100644
--- a/src/op= envpn/openssl_compat.h
+++ b/src/openvpn/openssl_compat.h
@@ -194,21 +194,12 @@
LIBRESSL_VE= RSION_NUMBER > 0x3050400fL) */

#if OP= ENSSL_VERSION_NUMBER < 0x30200000L && OPENSSL_VERSION_NUMBER >= ;=3D 0x30000000L
-#if d= efined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion&qu= ot;
-#endif
<= span style=3D"color: hsl(0, 100%, 40%);">-

static inline c= onst char *
SSL_get0_group_name(SSL *s)
{=
- int nid =3D SSL_g= et_negotiated_group(s);
+ int nid =3D (int)SSL_get_negotiated_group(s);
= return SSL_group_to_name(s, nid);
}
-
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
#endif=

/* Introduced in OpenSSL 3.6.0 */

To view, visit change 1359. To unsubscribe, or for help= writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I31024f93d9d9d0f678fb39d4758= a7e870bf00873
Gerrit-Change-Number: 1359
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --Xm6npHJD3dk=--