mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 21:47:59 +00:00
4676. [cleanup] Allow BIND to be built using OpenSSL 1.0.X with
deprecated functions removed. [RT #45706]
This commit is contained in:
parent
f4eb664ce3
commit
cbc80a42d3
3
CHANGES
3
CHANGES
@ -1,3 +1,6 @@
|
|||||||
|
4676. [cleanup] Allow BIND to be built using OpenSSL 1.0.X with
|
||||||
|
deprecated functions removed. [RT #45706]
|
||||||
|
|
||||||
4675. [cleanup] Don't use C++ keyword class. [RT #45726]
|
4675. [cleanup] Don't use C++ keyword class. [RT #45726]
|
||||||
|
|
||||||
4674. [func] "dig +sigchase", and related options "+topdown" and
|
4674. [func] "dig +sigchase", and related options "+topdown" and
|
||||||
|
@ -104,7 +104,7 @@ entropy_add(const void *buf, int num, double entropy) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
#if OPENSSL_VERSION_NUMBER >= 0x10000000L && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
static void
|
static void
|
||||||
lock_callback(int mode, int type, const char *file, int line) {
|
lock_callback(int mode, int type, const char *file, int line) {
|
||||||
UNUSED(file);
|
UNUSED(file);
|
||||||
@ -114,7 +114,9 @@ lock_callback(int mode, int type, const char *file, int line) {
|
|||||||
else
|
else
|
||||||
UNLOCK(&locks[type]);
|
UNLOCK(&locks[type]);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if OPENSSL_VERSION_NUMBER < 0x10000000L
|
||||||
static unsigned long
|
static unsigned long
|
||||||
id_callback(void) {
|
id_callback(void) {
|
||||||
return ((unsigned long)isc_thread_self());
|
return ((unsigned long)isc_thread_self());
|
||||||
@ -178,6 +180,14 @@ mem_realloc(void *ptr, size_t size FLARG) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OPENSSL_VERSION_NUMBER >= 0x10000000L && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
static void
|
||||||
|
_set_thread_id(CRYPTO_THREADID *id)
|
||||||
|
{
|
||||||
|
CRYPTO_THREADID_set_numeric(id, (unsigned long)pthread_self());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
dst__openssl_init(const char *engine) {
|
dst__openssl_init(const char *engine) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
@ -203,7 +213,11 @@ 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 >= 0x10000000L
|
||||||
|
CRYPTO_THREADID_set_callback(_set_thread_id);
|
||||||
|
# else
|
||||||
CRYPTO_set_id_callback(id_callback);
|
CRYPTO_set_id_callback(id_callback);
|
||||||
|
# endif
|
||||||
|
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
#endif
|
#endif
|
||||||
@ -324,7 +338,9 @@ 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 || defined(LIBRESSL_VERSION_NUMBER)
|
#if OPENSSL_VERSION_NUMBER >= 0x10000000L && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
ERR_remove_thread_state(NULL);
|
||||||
|
#elif OPENSSL_VERSION_NUMBER < 0x10000000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
ERR_remove_state(0);
|
ERR_remove_state(0);
|
||||||
#endif
|
#endif
|
||||||
ERR_free_strings();
|
ERR_free_strings();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user