aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-05-04 12:16:03 +0200
committerHans Nilsson <[email protected]>2018-05-04 12:20:46 +0200
commit0c0054aabef5a76e32957dbfa583cabeb051a8d0 (patch)
treef5fb117acedcafb726926970f43f632717f32d04 /lib
parentb5b627ded69445c06e8fbe34cda3421854c5582e (diff)
downloadotp-0c0054aabef5a76e32957dbfa583cabeb051a8d0.tar.gz
otp-0c0054aabef5a76e32957dbfa583cabeb051a8d0.tar.bz2
otp-0c0054aabef5a76e32957dbfa583cabeb051a8d0.zip
crypto: disable engine if OPENSSL_NO_EC* is set
If that flag is set, and openssl/engine.h is included, there will be an erro further down in files included by engine.h
Diffstat (limited to 'lib')
-rw-r--r--lib/crypto/c_src/crypto.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 9a3ea07c97..7e02e6c15c 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -60,7 +60,6 @@
#include <openssl/rand.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
-#include <openssl/engine.h>
#include <openssl/err.h>
/* Helper macro to construct a OPENSSL_VERSION_NUMBER.
@@ -121,10 +120,6 @@
#include <openssl/modes.h>
#endif
-#if OPENSSL_VERSION_NUMBER >= PACKED_OPENSSL_VERSION(0,9,8,'h')
-#define HAS_ENGINE_SUPPORT
-#endif
-
#include "crypto_callback.h"
#if OPENSSL_VERSION_NUMBER >= PACKED_OPENSSL_VERSION_PLAIN(0,9,8) \
@@ -185,6 +180,19 @@
# undef HAVE_RSA_SSLV23_PADDING
#endif
+#if OPENSSL_VERSION_NUMBER >= PACKED_OPENSSL_VERSION(0,9,8,'h') \
+ && defined(HAVE_EC)
+/* If OPENSSL_NO_EC is set, there will be an error in ec.h included from engine.h
+ So if EC is disabled, you can't use Engine either....
+*/
+# define HAS_ENGINE_SUPPORT
+#endif
+
+
+#if defined(HAS_ENGINE_SUPPORT)
+# include <openssl/engine.h>
+#endif
+
#if defined(HAVE_CMAC)
#include <openssl/cmac.h>
#endif