You've already forked opencryptoki
mirror of
https://github.com/opencryptoki/opencryptoki.git
synced 2026-10-25 17:39:16 +03:00
Only cleanup OpenSSL library context and providers if we are not in the library destructor. The library destructor calls C_Finalize if not already finalized, but this may happen during at-exit handlers when the program is terminating. At that point in time, the OpenSSL at-exit handler may already have performed cleanup which will then cause crashes when trying to cleanup the already freed library context here. We are leaking the library context and providers if one just unloads the library without calling C_Finalize. However, OpenSSL cleanup will clean up the context at program termination anyway Closes: https://github.com/opencryptoki/opencryptoki/issues/527 Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>