2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

4129. [port] Address API changes in OpenSSL 1.1.0. [RT #39532]

This commit is contained in:
Mark Andrews
2015-05-28 14:41:21 +10:00
parent a450977e98
commit 8bb630c751
7 changed files with 130 additions and 55 deletions

View File

@@ -88,6 +88,7 @@ entropy_getpseudo(unsigned char *buf, int num) {
return (result == ISC_R_SUCCESS ? 1 : -1);
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
static void
entropy_add(const void *buf, int num, double entropy) {
/*
@@ -97,6 +98,18 @@ entropy_add(const void *buf, int num, double entropy) {
UNUSED(num);
UNUSED(entropy);
}
#else
static int
entropy_add(const void *buf, int num, double entropy) {
/*
* Do nothing. The only call to this provides no useful data anyway.
*/
UNUSED(buf);
UNUSED(num);
UNUSED(entropy);
return (1);
}
#endif
static void
lock_callback(int mode, int type, const char *file, int line) {
@@ -108,10 +121,12 @@ lock_callback(int mode, int type, const char *file, int line) {
UNLOCK(&locks[type]);
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
static unsigned long
id_callback(void) {
return ((unsigned long)isc_thread_self());
}
#endif
static void *
mem_alloc(size_t size) {
@@ -172,7 +187,9 @@ dst__openssl_init(const char *engine) {
if (result != ISC_R_SUCCESS)
goto cleanup_mutexalloc;
CRYPTO_set_locking_callback(lock_callback);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
CRYPTO_set_id_callback(id_callback);
#endif
ERR_load_crypto_strings();
@@ -270,7 +287,9 @@ dst__openssl_destroy(void) {
CRYPTO_cleanup_all_ex_data();
#endif
ERR_clear_error();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
ERR_remove_state(0);
#endif
ERR_free_strings();
#ifdef DNS_CRYPTO_LEAKS