mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
4340. [port] Fix LibreSSL compatibility. [RT #40977]
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
4340. [port] Fix LibreSSL compatibility. [RT #40977]
|
||||||
|
|
||||||
4239. [func] Changed default servfail-ttl value to 1 second from 10.
|
4239. [func] Changed default servfail-ttl value to 1 second from 10.
|
||||||
Also, the maximum value is now 30 instead of 300. [RT #37556]
|
Also, the maximum value is now 30 instead of 300. [RT #37556]
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
#define USE_ENGINE 1
|
#define USE_ENGINE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#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
|
||||||
* the function like this before the BN_GENCB_new call:
|
* the function like this before the BN_GENCB_new call:
|
||||||
|
@@ -88,7 +88,7 @@ entropy_getpseudo(unsigned char *buf, int num) {
|
|||||||
return (result == ISC_R_SUCCESS ? 1 : -1);
|
return (result == ISC_R_SUCCESS ? 1 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
static void
|
static void
|
||||||
entropy_add(const void *buf, int num, double entropy) {
|
entropy_add(const void *buf, int num, double entropy) {
|
||||||
/*
|
/*
|
||||||
@@ -121,7 +121,7 @@ lock_callback(int mode, int type, const char *file, int line) {
|
|||||||
UNLOCK(&locks[type]);
|
UNLOCK(&locks[type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
static unsigned long
|
static unsigned long
|
||||||
id_callback(void) {
|
id_callback(void) {
|
||||||
return ((unsigned long)isc_thread_self());
|
return ((unsigned long)isc_thread_self());
|
||||||
@@ -187,7 +187,7 @@ dst__openssl_init(const char *engine) {
|
|||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
goto cleanup_mutexalloc;
|
goto cleanup_mutexalloc;
|
||||||
CRYPTO_set_locking_callback(lock_callback);
|
CRYPTO_set_locking_callback(lock_callback);
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
CRYPTO_set_id_callback(id_callback);
|
CRYPTO_set_id_callback(id_callback);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ dst__openssl_destroy(void) {
|
|||||||
CRYPTO_cleanup_all_ex_data();
|
CRYPTO_cleanup_all_ex_data();
|
||||||
#endif
|
#endif
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
ERR_remove_state(0);
|
ERR_remove_state(0);
|
||||||
#endif
|
#endif
|
||||||
ERR_free_strings();
|
ERR_free_strings();
|
||||||
|
@@ -173,7 +173,7 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
|
|||||||
DH *dh = NULL;
|
DH *dh = NULL;
|
||||||
#if OPENSSL_VERSION_NUMBER > 0x00908000L
|
#if OPENSSL_VERSION_NUMBER > 0x00908000L
|
||||||
BN_GENCB *cb;
|
BN_GENCB *cb;
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
BN_GENCB _cb;
|
BN_GENCB _cb;
|
||||||
#endif
|
#endif
|
||||||
union {
|
union {
|
||||||
@@ -210,7 +210,7 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
|
|||||||
if (dh == NULL)
|
if (dh == NULL)
|
||||||
return (dst__openssl_toresult(ISC_R_NOMEMORY));
|
return (dst__openssl_toresult(ISC_R_NOMEMORY));
|
||||||
cb = BN_GENCB_new();
|
cb = BN_GENCB_new();
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||||
if (cb == NULL) {
|
if (cb == NULL) {
|
||||||
DH_free(dh);
|
DH_free(dh);
|
||||||
return (dst__openssl_toresult(ISC_R_NOMEMORY));
|
return (dst__openssl_toresult(ISC_R_NOMEMORY));
|
||||||
|
@@ -359,7 +359,7 @@ openssldsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
|
|||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
#if OPENSSL_VERSION_NUMBER > 0x00908000L
|
#if OPENSSL_VERSION_NUMBER > 0x00908000L
|
||||||
BN_GENCB *cb;
|
BN_GENCB *cb;
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
BN_GENCB _cb;
|
BN_GENCB _cb;
|
||||||
#endif
|
#endif
|
||||||
union {
|
union {
|
||||||
@@ -383,7 +383,7 @@ openssldsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
|
|||||||
if (dsa == NULL)
|
if (dsa == NULL)
|
||||||
return (dst__openssl_toresult(DST_R_OPENSSLFAILURE));
|
return (dst__openssl_toresult(DST_R_OPENSSLFAILURE));
|
||||||
cb = BN_GENCB_new();
|
cb = BN_GENCB_new();
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||||
if (cb == NULL) {
|
if (cb == NULL) {
|
||||||
DSA_free(dsa);
|
DSA_free(dsa);
|
||||||
return (dst__openssl_toresult(DST_R_OPENSSLFAILURE));
|
return (dst__openssl_toresult(DST_R_OPENSSLFAILURE));
|
||||||
|
@@ -771,7 +771,7 @@ opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
|
|||||||
} u;
|
} u;
|
||||||
RSA *rsa = RSA_new();
|
RSA *rsa = RSA_new();
|
||||||
BIGNUM *e = BN_new();
|
BIGNUM *e = BN_new();
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
BN_GENCB _cb;
|
BN_GENCB _cb;
|
||||||
#endif
|
#endif
|
||||||
BN_GENCB *cb = BN_GENCB_new();
|
BN_GENCB *cb = BN_GENCB_new();
|
||||||
|
Reference in New Issue
Block a user