From: "flichtenheld (Code Review)" Date: Fri, 7 Nov 2025 15:38:22 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <3e489e5943393f15bc7e8dcaf97a7f75382b74fb-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="6pJmHuH4im8="; 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: plaisthos Cc: openvpn-devel --6pJmHuH4im8= 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/+/1359?usp=3Demail to review the following change. 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 --- M src/openvpn/openssl_compat.h 1 file changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/59/1359/1 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: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I31024f93d9d9d0f678fb39d4758a7e870bf00873 Gerrit-Change-Number: 1359 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --6pJmHuH4im8= 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

openssl_compat: Avoid conversion warning fo=
r 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, wh= ich does return a long.
So to avoid the conversion warning we need the c= ast.

Change-Id: I31024f93d9d9d0f678fb39d4758a7e870bf00873
Signed-= off-by: Frank Lichtenheld <frank@...2641...>
---
M src/openvpn/= openssl_compat.h
1 file changed, 1 insertion(+), 10 deletions(-)

=
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/ch=
anges/59/1359/1
diff --git a/src/openvpn/openssl_compat.h b/src/ope=
nvpn/openssl_compat.h
index fb3c9b1..b9af132 100644<= br>--- a/src/openvpn/openssl_compat.h
+++ b/src/openv= pn/openssl_compat.h
@@ -194,21 +194,12 @@
= LIBRESSL_VERSION_NUMBER > 0x3050400fL) */

#if OPENSSL_VERSION_NUMBER < 0x30200000L && OPENS= SL_VERSION_NUMBER >=3D 0x30000000L
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored = "-Wconversion"
-
<= span> 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);<= /span>
return SSL_group_to_name(s, nid);
}
-
-#if defined(__GNUC__) || defined(__clang__)=
-#pragma GCC diagnosti= c pop
-#endif #endif

/* Introduced in OpenSSL = 3.6.0 */

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I31024f93d9d9d0f678fb39d4758= a7e870bf00873
Gerrit-Change-Number: 1359
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...>
= --6pJmHuH4im8=--