Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/factory/MySQLTaskImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions src/manager/RouteManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -70,7 +69,6 @@ class RouteManager
if (ssl_ctx)
SSL_CTX_free(ssl_ctx);
}
#endif

public:
int state;
Expand Down
50 changes: 0 additions & 50 deletions src/manager/WFGlobal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
#include <mutex>
#include <condition_variable>
#include <openssl/ssl.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L
# include <openssl/err.h>
# include <openssl/engine.h>
# include <openssl/conf.h>
# include <openssl/crypto.h>
#endif
#include "CommScheduler.h"
#include "Executor.h"
#include "WFResourcePool.h"
Expand Down Expand Up @@ -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:
Expand All @@ -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();
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/MySQLMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 0 additions & 11 deletions src/protocol/SSLWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down