summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-07 09:08:58 -0500
committerNick Mathewson <nickm@torproject.org>2016-11-07 09:08:58 -0500
commitce8a1e25a2a7ea7f4c7ce72932b7ee08fa05b7d3 (patch)
tree4c5b22147a3ab3640da18d605d5fad76e30e48d1
parentf6a3d213e4ace95bbe0361878705d9a889f92974 (diff)
parent0bd55ed96a3132918472326261e766ae0e9dc347 (diff)
downloadtor-ce8a1e25a2a7ea7f4c7ce72932b7ee08fa05b7d3.tar.gz
tor-ce8a1e25a2a7ea7f4c7ce72932b7ee08fa05b7d3.zip
Merge branch 'bug20588' into maint-0.2.9
-rw-r--r--changes/bug205883
-rw-r--r--src/common/aes.c9
2 files changed, 11 insertions, 1 deletions
diff --git a/changes/bug20588 b/changes/bug20588
new file mode 100644
index 0000000000..be199b2de0
--- /dev/null
+++ b/changes/bug20588
@@ -0,0 +1,3 @@
+ o Minor bugfixes (portability):
+ - Fix compilation with OpenSSL 1.1 and less commonly-used
+ CPU architectures. Closes ticket 20588.
diff --git a/src/common/aes.c b/src/common/aes.c
index ef94d8a75c..35c2d1e3a5 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -56,7 +56,14 @@ ENABLE_GCC_WARNING(redundant-decls)
* gives us, and the best possible counter-mode implementation, and combine
* them.
*/
-#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_NOPATCH(1,0,1) && \
+#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_NOPATCH(1,1,0)
+
+/* With newer OpenSSL versions, the older fallback modes don't compile. So
+ * don't use them, even if we lack specific acceleration. */
+
+#define USE_EVP_AES_CTR
+
+#elif OPENSSL_VERSION_NUMBER >= OPENSSL_V_NOPATCH(1,0,1) && \
(defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64) || defined(__x86_64__) || \
defined(_M_AMD64) || defined(_M_X64) || defined(__INTEL__)) \