]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
openssl_compat: Avoid conversion warning for SSL_get_negotiated_group
authorFrank Lichtenheld <frank@lichtenheld.com>
Tue, 11 Nov 2025 15:32:24 +0000 (16:32 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 12 Nov 2025 13:57:40 +0000 (14:57 +0100)
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 <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1359
Message-Id: <20251111153230.29865-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34316.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/openssl_compat.h

index fb3c9b15b2d115d6acba8fc026f5a083bf565f3a..b9af13255fb4b6613e3f6d5624110ab883e75ecc 100644 (file)
@@ -194,21 +194,12 @@ SSL_get0_peer_signature_name(const SSL *ssl, const char **sigalg)
           LIBRESSL_VERSION_NUMBER > 0x3050400fL) */
 
 #if OPENSSL_VERSION_NUMBER < 0x30200000L && OPENSSL_VERSION_NUMBER >= 0x30000000L
-#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 = SSL_get_negotiated_group(s);
+    int nid = (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 */