]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
crypt_openssl_mgt: define DISABLE_ENGINES after OPENSSL_NO_ENGINE
authororbea <orbea@riseup.net>
Thu, 31 Aug 2023 21:35:52 +0000 (14:35 -0700)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 5 May 2025 16:33:48 +0000 (12:33 -0400)
With LibreSSL-3.8.1 these engines are no long available causing a build
failure, but LibreSSL correctly defines OPENSSL_NO_ENGINE as part of its
opensslfeatures.h. However Tor includes crypto_openssl_mgt.h before any
of the openssl includes which would define OPENSSL_NO_ENGINE and then
fails to define DISABLE_ENGINES.

As the define is used in only a single .c file it is best to move it
there.

Signed-off-by: orbea <orbea@riseup.net>
src/lib/crypt_ops/crypto_openssl_mgt.c
src/lib/crypt_ops/crypto_openssl_mgt.h

index 6c01cb6aa8f3568c857532366a90e4f4a4829d7b..ca12a825185cbdb2de3d75877810c7a3029e9c15 100644 (file)
@@ -40,6 +40,11 @@ ENABLE_GCC_WARNING("-Wredundant-decls")
 
 #include <string.h>
 
+#ifdef OPENSSL_NO_ENGINE
+/* Android's OpenSSL seems to have removed all of its Engine support. */
+#define DISABLE_ENGINES
+#endif
+
 #ifndef NEW_THREAD_API
 /** A number of preallocated mutexes for use by OpenSSL. */
 static tor_mutex_t **openssl_mutexes_ = NULL;
index 96a37721dd15ce9c1012ce04f507fa99faf7b9e0..eac0ec197796e803508842090c6b17a878d6e10c 100644 (file)
 #define OPENSSL_V_SERIES(a,b,c) \
   OPENSSL_VER((a),(b),(c),0,0)
 
-#ifdef OPENSSL_NO_ENGINE
-/* Android's OpenSSL seems to have removed all of its Engine support. */
-#define DISABLE_ENGINES
-#endif
-
 #if OPENSSL_VERSION_NUMBER >= OPENSSL_VER(1,1,0,0,5)
 /* OpenSSL as of 1.1.0pre4 has an "new" thread API, which doesn't require
  * setting up various callbacks.