]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use library constructor/destructor to initialize OpenSSL
authorOndřej Surý <ondrej@sury.org>
Tue, 9 Feb 2021 16:44:40 +0000 (17:44 +0100)
committerOndřej Surý <ondrej@isc.org>
Fri, 26 Feb 2021 16:18:06 +0000 (17:18 +0100)
commit2f0f531ee837a410835182ce101bae54cf8e5f2d
treeafa19612341826374ea50a604176a86b3a2114ef
parent59d51cdeb6ac4ccf2b3cfc89f7f95f881132d856
Use library constructor/destructor to initialize OpenSSL

Instead of calling isc_tls_initialize()/isc_tls_destroy() explicitly use
gcc/clang attributes on POSIX and DLLMain on Windows to initialize and
shutdown OpenSSL library.

This resolves the issue when isc_nm_create() / isc_nm_destroy() was
called multiple times and it would call OpenSSL library destructors from
isc_nm_destroy().

At the same time, since we now have introduced the ctor/dtor for libisc,
this commit moves the isc_mem API initialization (the list of the
contexts) and changes the isc_mem_checkdestroyed() to schedule the
checking of memory context on library unload instead of executing the
code immediately.
19 files changed:
aclocal.m4
config.h.in
configure
configure.ac
lib/dns/openssl_link.c
lib/isc/include/isc/tls.h
lib/isc/include/isc/util.h
lib/isc/lib.c
lib/isc/mem.c
lib/isc/mem_p.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tlsdns.c
lib/isc/tests/tlsdns_test.c
lib/isc/tls.c
lib/isc/tls_p.h [new file with mode: 0644]
lib/isc/win32/DLLMain.c
lib/isc/win32/libisc.def.in
m4/ax_gcc_func_attribute.m4 [new file with mode: 0644]
util/copyrights