aboutsummaryrefslogtreecommitdiff
path: root/keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'keys.c')
-rw-r--r--keys.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/keys.c b/keys.c
index 78bea9721c4c..8125de3f6b9f 100644
--- a/keys.c
+++ b/keys.c
@@ -23,8 +23,12 @@
#ifdef USE_DSA
#include <openssl/dsa.h>
#endif
-#ifndef OPENSSL_NO_ENGINE
+#if defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
#include <openssl/engine.h>
+#else
+# ifndef OPENSSL_NO_ENGINE
+# define OPENSSL_NO_ENGINE
+# endif
#endif
#endif /* HAVE_SSL */
@@ -116,23 +120,19 @@ ldns_key_new_frm_engine(ldns_key **key, ENGINE *e, char *key_id, ldns_algorithm
k = ldns_key_new();
if(!k) return LDNS_STATUS_MEM_ERR;
#ifndef S_SPLINT_S
- k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL);
- if(!k->_key.key) {
- ldns_key_free(k);
- return LDNS_STATUS_ERR;
- }
ldns_key_set_algorithm(k, (ldns_signing_algorithm) alg);
+ k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL);
if (!k->_key.key) {
ldns_key_free(k);
return LDNS_STATUS_ENGINE_KEY_NOT_LOADED;
- }
+ }
#endif /* splint */
*key = k;
return LDNS_STATUS_OK;
}
#endif
-#ifdef USE_GOST
+#if defined(USE_GOST) && !defined(OPENSSL_NO_ENGINE)
/** store GOST engine reference loaded into OpenSSL library */
ENGINE* ldns_gost_engine = NULL;