diff --git a/src/factory/MySQLTaskImpl.cc b/src/factory/MySQLTaskImpl.cc index ad3dd231ed..d167f8c581 100644 --- a/src/factory/MySQLTaskImpl.cc +++ b/src/factory/MySQLTaskImpl.cc @@ -213,9 +213,6 @@ CommMessageOut *ComplexMySQLTask::message_out() auth_switch_req->set_password(password_); auth_switch_req->set_auth_plugin_name(std::move(conn->str)); auth_switch_req->set_seed(conn->seed); -#if OPENSSL_VERSION_NUMBER < 0x10100000L - WFGlobal::get_ssl_client_ctx(); -#endif break; case ST_SHA256_PUBLIC_KEY_REQUEST: diff --git a/src/manager/RouteManager.h b/src/manager/RouteManager.h index cd660d4316..8286539172 100644 --- a/src/manager/RouteManager.h +++ b/src/manager/RouteManager.h @@ -46,7 +46,6 @@ class RouteManager class RouteTarget : public CommSchedTarget { -#if OPENSSL_VERSION_NUMBER >= 0x10100000L public: int init(const struct sockaddr *addr, socklen_t addrlen, SSL_CTX *ssl_ctx, int connect_timeout, int ssl_connect_timeout, int response_timeout, @@ -70,7 +69,6 @@ class RouteManager if (ssl_ctx) SSL_CTX_free(ssl_ctx); } -#endif public: int state; diff --git a/src/manager/WFGlobal.cc b/src/manager/WFGlobal.cc index c776f5d7a1..f8abbe888a 100644 --- a/src/manager/WFGlobal.cc +++ b/src/manager/WFGlobal.cc @@ -31,12 +31,6 @@ #include #include #include -#if OPENSSL_VERSION_NUMBER < 0x10100000L -# include -# include -# include -# include -#endif #include "CommScheduler.h" #include "Executor.h" #include "WFResourcePool.h" @@ -179,18 +173,6 @@ __WFGlobal::__WFGlobal() sync_max_ = 0; } -#if OPENSSL_VERSION_NUMBER < 0x10100000L -static std::mutex *__ssl_mutex; - -static void ssl_locking_callback(int mode, int type, const char* file, int line) -{ - if (mode & CRYPTO_LOCK) - __ssl_mutex[type].lock(); - else if (mode & CRYPTO_UNLOCK) - __ssl_mutex[type].unlock(); -} -#endif - class __SSLManager { public: @@ -206,15 +188,6 @@ class __SSLManager private: __SSLManager() { -#if OPENSSL_VERSION_NUMBER < 0x10100000L - __ssl_mutex = new std::mutex[CRYPTO_num_locks()]; - CRYPTO_set_locking_callback(ssl_locking_callback); - SSL_library_init(); - SSL_load_error_strings(); - //ERR_load_crypto_strings(); - //OpenSSL_add_all_algorithms(); -#endif - ssl_client_ctx_ = SSL_CTX_new(SSLv23_client_method()); if (ssl_client_ctx_ == NULL) abort(); @@ -223,29 +196,6 @@ class __SSLManager ~__SSLManager() { SSL_CTX_free(ssl_client_ctx_); - -#if OPENSSL_VERSION_NUMBER < 0x10100000L - //free ssl to avoid memory leak - FIPS_mode_set(0); - CRYPTO_set_locking_callback(NULL); -# ifdef CRYPTO_LOCK_ECDH - CRYPTO_THREADID_set_callback(NULL); -# else - CRYPTO_set_id_callback(NULL); -# endif - ENGINE_cleanup(); - CONF_modules_unload(1); - ERR_free_strings(); - EVP_cleanup(); -# ifdef CRYPTO_LOCK_ECDH - ERR_remove_thread_state(NULL); -# else - ERR_remove_state(0); -# endif - CRYPTO_cleanup_all_ex_data(); - sk_SSL_COMP_free(SSL_COMP_get_compression_methods()); - delete []__ssl_mutex; -#endif } private: diff --git a/src/protocol/MySQLMessage.cc b/src/protocol/MySQLMessage.cc index 22a78781a9..0e20eb3997 100644 --- a/src/protocol/MySQLMessage.cc +++ b/src/protocol/MySQLMessage.cc @@ -583,7 +583,7 @@ int MySQLRSAAuthRequest::encode(struct iovec vectors[], int max) EVP_PKEY_CTX *pkey_ctx; int ret = -1; - bio = BIO_new_mem_buf((void *)public_key_.c_str(), public_key_.size()); + bio = BIO_new_mem_buf(public_key_.c_str(), public_key_.size()); if (bio) { pkey = PEM_read_bio_PUBKEY(bio, NULL, NULL, NULL); diff --git a/src/protocol/SSLWrapper.cc b/src/protocol/SSLWrapper.cc index 6c29be5a9c..f7a80474f7 100644 --- a/src/protocol/SSLWrapper.cc +++ b/src/protocol/SSLWrapper.cc @@ -25,17 +25,6 @@ namespace protocol { -#if OPENSSL_VERSION_NUMBER < 0x10100000L -static inline BIO *__get_wbio(SSL *ssl) -{ - BIO *wbio = SSL_get_wbio(ssl); - BIO *next = BIO_next(wbio); - return next ? next : wbio; -} - -# define SSL_get_wbio(ssl) __get_wbio(ssl) -#endif - int SSLHandshaker::encode(struct iovec vectors[], int max) { BIO *wbio = SSL_get_wbio(this->ssl);