]> 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@sury.org>
Thu, 18 Feb 2021 18:33:54 +0000 (19:33 +0100)
commit494d0da522101fe7ddfb46db6b8c0eb9ac6a690a
tree5297488f2ac28373ea26c70ce406f35cb7f39683
parent4bde4f050be7365b972f8a5511138888c3367b99
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.
15 files changed:
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
util/copyrights