#include <openssl/crypto.h>
#include <openssl/bn.h>
-#if !defined(OPENSSL_NO_ENGINE) && \
- ((defined(CRYPTO_LOCK_ENGINE) && \
- (OPENSSL_VERSION_NUMBER >= 0x0090707f)) || \
- (OPENSSL_VERSION_NUMBER >= 0x10100000L))
-#define USE_ENGINE 1
-#endif
-
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
/*
* These are new in OpenSSL 1.1.0. BN_GENCB _cb needs to be declared in
dst__openssl_toresult3(isc_logcategory_t *category,
const char *funcname, isc_result_t fallback);
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
ENGINE *
dst__openssl_getengine(const char *engine);
#else
#include "dst_internal.h"
#include "dst_openssl.h"
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
#include <openssl/engine.h>
#endif
static int nlocks;
#endif
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
static ENGINE *e = NULL;
#endif
dst__openssl_init(const char *engine) {
isc_result_t result;
-#if !defined(USE_ENGINE)
+#if defined(OPENSSL_NO_ENGINE)
UNUSED(engine);
#endif
ERR_load_crypto_strings();
#endif
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
#if !defined(CONF_MFLAGS_DEFAULT_SECTION)
OPENSSL_config(NULL);
#else
}
}
-#endif /* USE_ENGINE */
+#endif /* !defined(OPENSSL_NO_ENGINE) */
/* Protect ourselves against unseeded PRNG */
if (RAND_status() != 1) {
return (ISC_R_SUCCESS);
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
cleanup_rm:
if (e != NULL)
ENGINE_free(e);
#endif
OBJ_cleanup();
EVP_cleanup();
-#if defined(USE_ENGINE)
+#if !defined(OPENSSL_NO_ENGINE)
if (e != NULL)
ENGINE_free(e);
e = NULL;
-#if defined(USE_ENGINE) && OPENSSL_VERSION_NUMBER >= 0x00907000L
+#if !defined(OPENSSL_NO_ENGINE) && OPENSSL_VERSION_NUMBER >= 0x00907000L
ENGINE_cleanup();
#endif
#endif
return (result);
}
-#if defined(USE_ENGINE)
+#if !defined(OPENSSL_NO_ENGINE)
ENGINE *
dst__openssl_getengine(const char *engine) {
#if OPENSSL_VERSION_NUMBER > 0x00908000L
#include <openssl/bn.h>
#endif
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
#include <openssl/engine.h>
#endif
isc_result_t ret;
int i;
RSA *rsa = NULL, *pubrsa = NULL;
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
ENGINE *ep = NULL;
const BIGNUM *ex = NULL;
#endif
isc_mem_t *mctx = key->mctx;
const char *engine = NULL, *label = NULL;
-#if defined(USE_ENGINE) || USE_EVP
+#if !defined(OPENSSL_NO_ENGINE) || USE_EVP
EVP_PKEY *pkey = NULL;
#endif
BIGNUM *n = NULL, *e = NULL, *d = NULL;
* See if we can fetch it.
*/
if (label != NULL) {
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
if (engine == NULL)
DST_RET(DST_R_NOENGINE);
ep = dst__openssl_getengine(engine);
opensslrsa_fromlabel(dst_key_t *key, const char *engine, const char *label,
const char *pin)
{
-#ifdef USE_ENGINE
+#if !defined(OPENSSL_NO_ENGINE)
ENGINE *e = NULL;
isc_result_t ret;
EVP_PKEY *pkey = NULL;