summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2019-02-14 18:01:04 +0200
committerGeorge Kadianakis <desnacked@riseup.net>2019-02-14 18:01:04 +0200
commit8dcecfb00028aa57ee8fb7bd6c9b817da365bdf2 (patch)
tree844d1545f1b406e323036b95222df3f55e330f86
parent4041ff5543084978ab3a1f765280489ddc8ef02c (diff)
parentd83c299eba8010204b3fe0760b1372c7564889fe (diff)
downloadtor-8dcecfb00028aa57ee8fb7bd6c9b817da365bdf2.tar.gz
tor-8dcecfb00028aa57ee8fb7bd6c9b817da365bdf2.zip
Merge branch 'maint-0.3.5' into release-0.3.5
-rw-r--r--changes/ticket290264
-rw-r--r--src/lib/crypt_ops/aes_openssl.c2
-rw-r--r--src/lib/crypt_ops/crypto_hkdf.c1
-rw-r--r--src/lib/crypt_ops/crypto_openssl_mgt.h2
-rw-r--r--src/lib/crypt_ops/crypto_rand.c1
-rw-r--r--src/lib/crypt_ops/crypto_rsa.c4
-rw-r--r--src/lib/tls/x509_openssl.c3
7 files changed, 15 insertions, 2 deletions
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".
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_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 <openssl/evp.h>
#include <openssl/opensslv.h>
#if defined(HAVE_ERR_LOAD_KDF_STRINGS)
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
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 <openssl/rand.h>
+#include <openssl/sha.h>
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 <sys/stat.h>
#endif
+#ifdef ENABLE_OPENSSL
+#include <openssl/rsa.h>
+#endif
+
/** Return the number of bytes added by padding method <b>padding</b>.
*/
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 <openssl/asn1.h>
#include <openssl/bio.h>
#include <openssl/bn.h>
+#include <openssl/evp.h>
+#include <openssl/objects.h>
#include <openssl/rsa.h>
+#include <openssl/x509.h>
ENABLE_GCC_WARNING(redundant-decls)