summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesus Fernandez Manzano <jesferman1993@hotmail.com>2017-06-14 11:33:50 +0200
committerJesus Fernandez Manzano <jesus.manzano@galgus.net>2017-06-22 10:55:08 +0200
commit67264053434fa772bd082f9f5ce578fc1ddd9855 (patch)
treea7b26c6a442639590c4f01bbb5f2dbc2b754c883
parent9e7f3703fdf23c4a88f6e5f959a6281f0f0550ec (diff)
downloadrabbitmq-c-67264053434fa772bd082f9f5ce578fc1ddd9855.tar.gz
Properly deinit of OpenSSL
-rw-r--r--librabbitmq/amqp_openssl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c
index d7ff38d..9107b53 100644
--- a/librabbitmq/amqp_openssl.c
+++ b/librabbitmq/amqp_openssl.c
@@ -44,6 +44,7 @@
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/x509v3.h>
+#include <openssl/engine.h>
#include <stdlib.h>
#include <string.h>
@@ -662,8 +663,19 @@ destroy_openssl(void)
* safely. We do leak the amqp_openssl_lockarray. Which is only
* an issue if you repeatedly unload and load the library
*/
+ ERR_remove_state(0);
+ FIPS_mode_set(0);
CRYPTO_set_locking_callback(NULL);
CRYPTO_set_id_callback(NULL);
+ ENGINE_cleanup();
+ CONF_modules_free();
+ EVP_cleanup();
+ CRYPTO_cleanup_all_ex_data();
+ ERR_free_strings();
+ openssl_initialized = 0;
+ #if (OPENSSL_VERSION_NUMBER >= 0x10002003L)
+ SSL_COMP_free_compression_methods();
+ #endif
}
pthread_mutex_unlock(&openssl_init_mutex);