Open t8m opened 6 months ago
The FIPS module already uses constructors and destructors in at least partially multiplatform way. So we can take things from there.
I have a draft pull request submitted: https://github.com/openssl/openssl/pull/24148
it does not update documentation yet. I have to questions:
what should we do with no-atexit build time option? Should it be removed too? or should it stay and turned to be no-op?
also should we add some kind of mechanism to allow application to determine if call to OPENSSL_cleanup() is handled implicitly (via linker -- library destructor)?
IMO we can keep no-atexit (and add an alias for it that would have a better name - no-implicit-cleanup
?) to switch off the implicit call of OPENSSL_cleanup() from the library destructor.
And make no-atexit the default in 3.4. OTC decided we should pursue this in https://github.com/openssl/openssl/issues/23575#issuecomment-1953825541
1) Use FIPS provider as model for using constructors/destructors instead of atexit in libcrypto/libssl 2) If constructors aren't available just don't clean up memory