[tor-commits] [tor/maint-0.3.5] configure: disable OpenSSL deprecation warnings with OpenSSL >= 3

dgoulet at torproject.org dgoulet at torproject.org
Thu Jan 28 17:07:05 UTC 2021


commit e399d32cdf8b77b68345290f59bb315d3ed7a5d9
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Oct 28 10:30:24 2020 -0400

    configure: disable OpenSSL deprecation warnings with OpenSSL >= 3
    
    We can't do this in the C headers, since by the time we include
    `opensslv.h` in order to check the openssl version number, we will
    have included `openssl/macros.h`, which is the thing that checks
    whether we disabled deprecation warnings.
---
 configure.ac | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f30a7efa91..6c8456d0c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -937,13 +937,30 @@ LIBS="$TOR_OPENSSL_LIBS $LIBS"
 LDFLAGS="$TOR_LDFLAGS_openssl $LDFLAGS"
 CPPFLAGS="$TOR_CPPFLAGS_openssl $CPPFLAGS"
 
+dnl Tor currently uses a number of APIs that are deprecated in OpenSSL 3.0.0
+dnl and later.  We want to migrate away from them, but that will be a lot of
+dnl work. (See ticket tor#40166.)  For now, we disable the deprecation
+dnl warnings.
+
+AC_MSG_CHECKING([for OpenSSL >= 3.0.0])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <openssl/opensslv.h>
+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER <= 0x30000000L
+#error "you_have_version_3"
+#endif
+   ]], [[]])],
+   [ AC_MSG_RESULT([no]) ],
+   [ AC_MSG_RESULT([yes]);
+     AC_DEFINE(OPENSSL_SUPPRESS_DEPRECATED, 1, [disable openssl deprecated-function warnings]) ])
+
+AC_MSG_CHECKING([for OpenSSL < 1.0.1])
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <openssl/opensslv.h>
 #if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1000100fL
 #error "too old"
 #endif
    ]], [[]])],
-   [ : ],
+   [ AC_MSG_RESULT([no]) ],
    [ AC_MSG_ERROR([OpenSSL is too old. We require 1.0.1 or later. You can specify a path to a newer one with --with-openssl-dir.]) ])
 
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[





More information about the tor-commits mailing list