]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_setup: Suppress OpenSSL 3 deprecation warnings
authorJay Satiro <raysatiro@yahoo.com>
Fri, 17 Feb 2023 08:40:05 +0000 (03:40 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 19 Feb 2023 00:02:37 +0000 (19:02 -0500)
- Define OPENSSL_SUPPRESS_DEPRECATED.

OpenSSL 3 has deprecated some of the functions libcurl uses such as
those with DES, MD5 and ENGINE prefix. We don't have replacements for
those functions so the warnings were disabled in autotools and cmake
builds, but still showed in other builds.

Closes https://github.com/curl/curl/pull/10543

CMakeLists.txt
lib/curl_setup.h
m4/curl-amissl.m4
m4/curl-openssl.m4

index eb998fb0f3572c98d3d5cf0f4d8ef15832242bf1..b97704bfef45110a81fde92f86994dde73d7ae35 100644 (file)
@@ -448,8 +448,6 @@ if(CURL_USE_OPENSSL)
   if(NOT DEFINED HAVE_BORINGSSL)
     check_symbol_exists(OPENSSL_IS_BORINGSSL "openssl/base.h" HAVE_BORINGSSL)
   endif()
-
-  add_definitions(-DOPENSSL_SUPPRESS_DEPRECATED)
 endif()
 
 if(CURL_USE_MBEDTLS)
index 0a4a159c0813f6518a0a9795d7ad372d8c46edf1..a8cc71503e5acd1b572b7b4f3deefd2e87325f1b 100644 (file)
@@ -862,4 +862,10 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf,
 #  endif
 #endif
 
+/* OpenSSLv3 marks DES, MD5 and ENGINE functions deprecated but we have no
+   replacements (yet) so tell the compiler to not warn for them. */
+#ifdef USE_OPENSSL
+#define OPENSSL_SUPPRESS_DEPRECATED
+#endif
+
 #endif /* HEADER_CURL_SETUP_H */
index 4d59fcc790babf090237dd51f93ef189832000ac..4b80842b915a53f399055453e991971e9261e600 100644 (file)
@@ -55,11 +55,6 @@ if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then
       AC_DEFINE_UNQUOTED(HAVE_OPENSSL3, 1, [Define to 1 if using OpenSSL 3 or later.])
       AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
                        openssl/pem.h openssl/ssl.h openssl/err.h)
-      dnl OpenSSLv3 marks the DES functions deprecated but we have no
-      dnl replacements (yet) so tell the compiler to not warn for them
-      dnl
-      dnl Ask OpenSSL to suppress the warnings.
-      CPPFLAGS="$CPPFLAGS -DOPENSSL_SUPPRESS_DEPRECATED"
     ],[
       AC_MSG_RESULT([no])
     ])
index 199288165f334a8fc4de8d147044d6c98dd970a5..e41569f37a36ead481446a67aed4fdc52a83dc77 100644 (file)
@@ -310,11 +310,6 @@ if test "x$OPT_OPENSSL" != xno; then
       AC_MSG_RESULT([yes])
       AC_DEFINE_UNQUOTED(HAVE_OPENSSL3, 1,
         [Define to 1 if using OpenSSL 3 or later.])
-      dnl OpenSSLv3 marks the DES functions deprecated but we have no
-      dnl replacements (yet) so tell the compiler to not warn for them
-      dnl
-      dnl Ask OpenSSL to suppress the warnings.
-      CPPFLAGS="$CPPFLAGS -DOPENSSL_SUPPRESS_DEPRECATED"
       ssl_msg="OpenSSL v3+"
     ],[
       AC_MSG_RESULT([no])