Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
e49d93c2
Commit
e49d93c2
authored
Oct 31, 2016
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
locks are only need in OpenSSL < 1.1
parent
56c6fc0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
lib/dns/openssl_link.c
lib/dns/openssl_link.c
+5
-1
No files found.
lib/dns/openssl_link.c
View file @
e49d93c2
...
...
@@ -49,8 +49,10 @@
static
RAND_METHOD
*
rm
=
NULL
;
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
static
isc_mutex_t
*
locks
=
NULL
;
static
int
nlocks
;
#endif
#ifdef USE_ENGINE
static
ENGINE
*
e
=
NULL
;
...
...
@@ -185,6 +187,7 @@ dst__openssl_init(const char *engine) {
CRYPTO_mem_ctrl
(
CRYPTO_MEM_CHECK_ON
);
#endif
CRYPTO_set_mem_functions
(
mem_alloc
,
mem_realloc
,
mem_free
);
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
nlocks
=
CRYPTO_num_locks
();
locks
=
mem_alloc
(
sizeof
(
isc_mutex_t
)
*
nlocks
FILELINE
);
if
(
locks
==
NULL
)
...
...
@@ -192,7 +195,6 @@ dst__openssl_init(const char *engine) {
result
=
isc_mutexblock_init
(
locks
,
nlocks
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
cleanup_mutexalloc
;
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
CRYPTO_set_locking_callback
(
lock_callback
);
CRYPTO_set_id_callback
(
id_callback
);
#endif
...
...
@@ -269,11 +271,13 @@ dst__openssl_init(const char *engine) {
rm
=
NULL
;
#endif
cleanup_mutexinit:
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
CRYPTO_set_locking_callback
(
NULL
);
DESTROYMUTEXBLOCK
(
locks
,
nlocks
);
cleanup_mutexalloc:
mem_free
(
locks
FILELINE
);
locks
=
NULL
;
#endif
return
(
result
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment