mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
Use standard OPENSSL_NO_ENGINE instead of custom USE_ENGINE define
This commit is contained in:
@@ -23,13 +23,6 @@
|
|||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
#include <openssl/bn.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)
|
#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
|
* These are new in OpenSSL 1.1.0. BN_GENCB _cb needs to be declared in
|
||||||
@@ -65,7 +58,7 @@ isc_result_t
|
|||||||
dst__openssl_toresult3(isc_logcategory_t *category,
|
dst__openssl_toresult3(isc_logcategory_t *category,
|
||||||
const char *funcname, isc_result_t fallback);
|
const char *funcname, isc_result_t fallback);
|
||||||
|
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
ENGINE *
|
ENGINE *
|
||||||
dst__openssl_getengine(const char *engine);
|
dst__openssl_getengine(const char *engine);
|
||||||
#else
|
#else
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
#include "dst_internal.h"
|
#include "dst_internal.h"
|
||||||
#include "dst_openssl.h"
|
#include "dst_openssl.h"
|
||||||
|
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ static isc_mutex_t *locks = NULL;
|
|||||||
static int nlocks;
|
static int nlocks;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
static ENGINE *e = NULL;
|
static ENGINE *e = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ isc_result_t
|
|||||||
dst__openssl_init(const char *engine) {
|
dst__openssl_init(const char *engine) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
||||||
#if !defined(USE_ENGINE)
|
#if defined(OPENSSL_NO_ENGINE)
|
||||||
UNUSED(engine);
|
UNUSED(engine);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ dst__openssl_init(const char *engine) {
|
|||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
#if !defined(CONF_MFLAGS_DEFAULT_SECTION)
|
#if !defined(CONF_MFLAGS_DEFAULT_SECTION)
|
||||||
OPENSSL_config(NULL);
|
OPENSSL_config(NULL);
|
||||||
#else
|
#else
|
||||||
@@ -207,7 +207,7 @@ dst__openssl_init(const char *engine) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_ENGINE */
|
#endif /* !defined(OPENSSL_NO_ENGINE) */
|
||||||
|
|
||||||
/* Protect ourselves against unseeded PRNG */
|
/* Protect ourselves against unseeded PRNG */
|
||||||
if (RAND_status() != 1) {
|
if (RAND_status() != 1) {
|
||||||
@@ -219,7 +219,7 @@ dst__openssl_init(const char *engine) {
|
|||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
cleanup_rm:
|
cleanup_rm:
|
||||||
if (e != NULL)
|
if (e != NULL)
|
||||||
ENGINE_free(e);
|
ENGINE_free(e);
|
||||||
@@ -248,11 +248,11 @@ dst__openssl_destroy(void) {
|
|||||||
#endif
|
#endif
|
||||||
OBJ_cleanup();
|
OBJ_cleanup();
|
||||||
EVP_cleanup();
|
EVP_cleanup();
|
||||||
#if defined(USE_ENGINE)
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
if (e != NULL)
|
if (e != NULL)
|
||||||
ENGINE_free(e);
|
ENGINE_free(e);
|
||||||
e = NULL;
|
e = NULL;
|
||||||
#if defined(USE_ENGINE) && OPENSSL_VERSION_NUMBER >= 0x00907000L
|
#if !defined(OPENSSL_NO_ENGINE) && OPENSSL_VERSION_NUMBER >= 0x00907000L
|
||||||
ENGINE_cleanup();
|
ENGINE_cleanup();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -364,7 +364,7 @@ dst__openssl_toresult3(isc_logcategory_t *category,
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(USE_ENGINE)
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
ENGINE *
|
ENGINE *
|
||||||
dst__openssl_getengine(const char *engine) {
|
dst__openssl_getengine(const char *engine) {
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
#if OPENSSL_VERSION_NUMBER > 0x00908000L
|
#if OPENSSL_VERSION_NUMBER > 0x00908000L
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1482,13 +1482,13 @@ opensslrsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
|
|||||||
isc_result_t ret;
|
isc_result_t ret;
|
||||||
int i;
|
int i;
|
||||||
RSA *rsa = NULL, *pubrsa = NULL;
|
RSA *rsa = NULL, *pubrsa = NULL;
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
ENGINE *ep = NULL;
|
ENGINE *ep = NULL;
|
||||||
const BIGNUM *ex = NULL;
|
const BIGNUM *ex = NULL;
|
||||||
#endif
|
#endif
|
||||||
isc_mem_t *mctx = key->mctx;
|
isc_mem_t *mctx = key->mctx;
|
||||||
const char *engine = NULL, *label = NULL;
|
const char *engine = NULL, *label = NULL;
|
||||||
#if defined(USE_ENGINE) || USE_EVP
|
#if !defined(OPENSSL_NO_ENGINE) || USE_EVP
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
#endif
|
#endif
|
||||||
BIGNUM *n = NULL, *e = NULL, *d = NULL;
|
BIGNUM *n = NULL, *e = NULL, *d = NULL;
|
||||||
@@ -1541,7 +1541,7 @@ opensslrsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
|
|||||||
* See if we can fetch it.
|
* See if we can fetch it.
|
||||||
*/
|
*/
|
||||||
if (label != NULL) {
|
if (label != NULL) {
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
if (engine == NULL)
|
if (engine == NULL)
|
||||||
DST_RET(DST_R_NOENGINE);
|
DST_RET(DST_R_NOENGINE);
|
||||||
ep = dst__openssl_getengine(engine);
|
ep = dst__openssl_getengine(engine);
|
||||||
@@ -1690,7 +1690,7 @@ static isc_result_t
|
|||||||
opensslrsa_fromlabel(dst_key_t *key, const char *engine, const char *label,
|
opensslrsa_fromlabel(dst_key_t *key, const char *engine, const char *label,
|
||||||
const char *pin)
|
const char *pin)
|
||||||
{
|
{
|
||||||
#ifdef USE_ENGINE
|
#if !defined(OPENSSL_NO_ENGINE)
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
isc_result_t ret;
|
isc_result_t ret;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
|
Reference in New Issue
Block a user