openssl / project

Tracking of project related issues
2 stars 1 forks source link

Investigate replacing the atexit calls with use of library destructors #461

Open t8m opened 6 months ago

t8m commented 6 months ago

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

t8m commented 5 months ago

The FIPS module already uses constructors and destructors in at least partially multiplatform way. So we can take things from there.

Sashan commented 4 months ago

I have a draft pull request submitted: https://github.com/openssl/openssl/pull/24148

it does not update documentation yet. I have to questions:

t8m commented 4 months ago
  • 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.