diff mbox series

[ima-evm-utils,1/3] Call OPENSSL_Cleanup before main exit to avoid crashes when engine was used

Message ID 20240621005912.1365462-2-stefanb@linux.vnet.ibm.com (mailing list archive)
State New
Headers show
Series Enable and disable OpenSSL provider tests | expand

Commit Message

Stefan Berger June 21, 2024, 12:59 a.m. UTC
From: Stefan Berger <stefanb@linux.ibm.com>

When OPENSSL_Cleanup is called via destructor after main() was left then
evmctl crashes on Ubuntu 24.04 (Noble). This can be avoided by calling
OpenSSL_Cleanup explicitly before leaving main().

Link: https://bugs.launchpad.net/ubuntu/+source/softhsm2/+bug/2059340
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 src/evmctl.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/src/evmctl.c b/src/evmctl.c
index 3ebda6f..ad75853 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
@@ -3347,5 +3347,8 @@  error:
 	ERR_free_strings();
 	EVP_cleanup();
 	BIO_free(NULL);
+#if OPENSSL_VERSION_NUMBER >= 0x30000000
+	OPENSSL_cleanup();
+#endif
 	return err;
 }