From b9abdcd6bce961baea17274ff6d213322d2b46d7 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 8 Feb 2019 08:50:04 -0500 Subject: [PATCH 1/3] Fix compilation when openssl is compiled without engine support. Patch from Mangix. Closes part of ticket 29026. --- src/lib/crypt_ops/aes_openssl.c | 2 +- src/lib/crypt_ops/crypto_openssl_mgt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/crypt_ops/aes_openssl.c b/src/lib/crypt_ops/aes_openssl.c index 42ee924a8a..2f985d4512 100644 --- a/src/lib/crypt_ops/aes_openssl.c +++ b/src/lib/crypt_ops/aes_openssl.c @@ -43,7 +43,7 @@ ENABLE_GCC_WARNING(redundant-decls) #include "lib/log/log.h" #include "lib/ctime/di_ops.h" -#ifdef ANDROID +#ifdef OPENSSL_NO_ENGINE /* Android's OpenSSL seems to have removed all of its Engine support. */ #define DISABLE_ENGINES #endif diff --git a/src/lib/crypt_ops/crypto_openssl_mgt.h b/src/lib/crypt_ops/crypto_openssl_mgt.h index 83fb44cadf..a3dd03aa04 100644 --- a/src/lib/crypt_ops/crypto_openssl_mgt.h +++ b/src/lib/crypt_ops/crypto_openssl_mgt.h @@ -50,7 +50,7 @@ #define OPENSSL_V_SERIES(a,b,c) \ OPENSSL_VER((a),(b),(c),0,0) -#ifdef ANDROID +#ifdef OPENSSL_NO_ENGINE /* Android's OpenSSL seems to have removed all of its Engine support. */ #define DISABLE_ENGINES #endif From 49ec29044d12ff1d609ebe491f08f84e958be748 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 8 Feb 2019 08:51:04 -0500 Subject: [PATCH 2/3] Add more openssl includes to fix no-deprecated compilation Closes ticket 29026; patch from Mangix. --- src/lib/crypt_ops/crypto_hkdf.c | 1 + src/lib/crypt_ops/crypto_rand.c | 1 + src/lib/crypt_ops/crypto_rsa.c | 4 ++++ src/lib/tls/x509_openssl.c | 3 +++ 4 files changed, 9 insertions(+) diff --git a/src/lib/crypt_ops/crypto_hkdf.c b/src/lib/crypt_ops/crypto_hkdf.c index 6c82fa14f6..fd2e701651 100644 --- a/src/lib/crypt_ops/crypto_hkdf.c +++ b/src/lib/crypt_ops/crypto_hkdf.c @@ -18,6 +18,7 @@ #include "lib/log/util_bug.h" #ifdef ENABLE_OPENSSL +#include #include #if defined(HAVE_ERR_LOAD_KDF_STRINGS) diff --git a/src/lib/crypt_ops/crypto_rand.c b/src/lib/crypt_ops/crypto_rand.c index 70b2965ca4..915fe0870d 100644 --- a/src/lib/crypt_ops/crypto_rand.c +++ b/src/lib/crypt_ops/crypto_rand.c @@ -45,6 +45,7 @@ #ifdef ENABLE_OPENSSL DISABLE_GCC_WARNING(redundant-decls) #include +#include ENABLE_GCC_WARNING(redundant-decls) #endif diff --git a/src/lib/crypt_ops/crypto_rsa.c b/src/lib/crypt_ops/crypto_rsa.c index 2b977b0b9b..c9189b0dfc 100644 --- a/src/lib/crypt_ops/crypto_rsa.c +++ b/src/lib/crypt_ops/crypto_rsa.c @@ -31,6 +31,10 @@ #include #endif +#ifdef ENABLE_OPENSSL +#include +#endif + /** Return the number of bytes added by padding method padding. */ int diff --git a/src/lib/tls/x509_openssl.c b/src/lib/tls/x509_openssl.c index cf276c4240..a344279c22 100644 --- a/src/lib/tls/x509_openssl.c +++ b/src/lib/tls/x509_openssl.c @@ -31,7 +31,10 @@ DISABLE_GCC_WARNING(redundant-decls) #include #include #include +#include +#include #include +#include ENABLE_GCC_WARNING(redundant-decls) From b63404ebba747337aece30555d94150b4d1bdd30 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 8 Feb 2019 08:52:46 -0500 Subject: [PATCH 3/3] Changes file for ticket29026. --- changes/ticket29026 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changes/ticket29026 diff --git a/changes/ticket29026 b/changes/ticket29026 new file mode 100644 index 0000000000..1db873dfcf --- /dev/null +++ b/changes/ticket29026 @@ -0,0 +1,4 @@ + o Minor features (compilation): + - Compile correctly when OpenSSL is built with engine support + disabled, or with deprecated APIs disabled. Closes ticket + 29026. Patches from "Mangix".