]> git.ipfire.org Git - thirdparty/openssl.git/commit
Make OPENSSL_cleanup() G A
authorBob Beck <beck@openssl.org>
Thu, 22 Jan 2026 19:22:34 +0000 (12:22 -0700)
committerNeil Horman <nhorman@openssl.org>
Thu, 5 Feb 2026 19:19:09 +0000 (14:19 -0500)
commit7e56cab285e208c500110767c7edfaec9b96155c
treecef836f0dcfb7122303b72a27adf9757a4b44545
parent156347ff2cc9145fa5f4f4a3a7f7546e242accc8
Make OPENSSL_cleanup() G A

(Your choice of G and A words)

This installs a global destructor if we have destructor support.

The global destructor does nothing and immediately returns under
normal operation. If a global flag indicating that global cleanup
is wanted, it does what OPENSSL_cleanup() used to do.

OPENSSL_cleanup() is then modified to set the global flag indicating
that global cleanup is wanted. At this point if we have destructor
support, it immeditely returns. If we do not have destructor support,
it manually calls the destructor function (meaning without destructor
support it does exactly what it used to do).

This ensures that if we have destructor support, the actions of an
OPENSSL_cleanup() requested by an application will only happen
after any subordinate library destructors which could call into
OpenSSL functions have already run.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
MergeDate: Thu Feb  5 19:19:17 2026
(Merged from https://github.com/openssl/openssl/pull/29721)
CHANGES.md
crypto/dllmain.c
crypto/init.c
doc/man3/OPENSSL_init_crypto.pod
include/internal/e_os.h