summaryrefslogtreecommitdiff
path: root/plugins/OpenSSL/src/ssl_openssl.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-16 22:59:10 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-16 22:59:10 +0300
commit89979c595a7711925499db9045cdc25e330b9f36 (patch)
tree6d8328802e5217d48e65473d57dd9a8f3f5b8419 /plugins/OpenSSL/src/ssl_openssl.cpp
parent4269a726e3ca96a1676d35600f32c29ae5e120a6 (diff)
OpenSSL: dynamic dll loading removed
Diffstat (limited to 'plugins/OpenSSL/src/ssl_openssl.cpp')
-rw-r--r--plugins/OpenSSL/src/ssl_openssl.cpp30
1 files changed, 7 insertions, 23 deletions
diff --git a/plugins/OpenSSL/src/ssl_openssl.cpp b/plugins/OpenSSL/src/ssl_openssl.cpp
index 6f0791475b..6340fcf09d 100644
--- a/plugins/OpenSSL/src/ssl_openssl.cpp
+++ b/plugins/OpenSSL/src/ssl_openssl.cpp
@@ -59,16 +59,7 @@ static void SSL_library_unload(void)
WaitForSingleObject(g_hSslMutex, INFINITE);
- FreeLibrary(g_hOpenSSL);
- g_hOpenSSL = NULL;
-
- FreeLibrary(g_hOpenSSLCrypto);
- g_hOpenSSLCrypto = NULL;
- FreeLibrary(g_hWinCrypt);
- g_hWinCrypt = NULL;
-
bSslInitDone = false;
-
ReleaseMutex(g_hSslMutex);
}
@@ -80,20 +71,13 @@ static bool SSL_library_load(void)
WaitForSingleObject(g_hSslMutex, INFINITE);
- if (!bSslInitDone) {
- g_hOpenSSLCrypto = LoadLibraryA("libeay32.dll");
- g_hOpenSSL = LoadLibraryA("ssleay32.dll");
- g_hWinCrypt = LoadLibraryA("crypt32.dll");
- if (g_hOpenSSL && g_hOpenSSLCrypto && g_hWinCrypt) {
- // init OpenSSL
- SSL_library_init();
- SSL_load_error_strings();
- CRYPTO_set_mem_functions(mir_calloc, mir_realloc, mir_free);
- // FIXME check errors
-
- bSslInitDone = true;
- }
- else SSL_library_unload();
+ if (!bSslInitDone) { // init OpenSSL
+ SSL_library_init();
+ SSL_load_error_strings();
+ CRYPTO_set_mem_functions(mir_calloc, mir_realloc, mir_free);
+ // FIXME check errors
+
+ bSslInitDone = true;
}
return bSslInitDone;