You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Disable BIO methods for read/write by default
This commit is contained in:
@@ -51,9 +51,11 @@ static SSL_CTX *SSL_context= NULL;
|
|||||||
static pthread_mutex_t LOCK_openssl_config;
|
static pthread_mutex_t LOCK_openssl_config;
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
static pthread_mutex_t *LOCK_crypto= NULL;
|
static pthread_mutex_t *LOCK_crypto= NULL;
|
||||||
|
#endif
|
||||||
|
#if OPENSSL_USE_BIOMETHOD
|
||||||
static int ma_bio_read(BIO *h, char *buf, int size);
|
static int ma_bio_read(BIO *h, char *buf, int size);
|
||||||
static int ma_bio_write(BIO *h, const char *buf, int size);
|
static int ma_bio_write(BIO *h, const char *buf, int size);
|
||||||
static BIO_METHOD ma_BIO_methods;
|
static BIO_METHOD ma_BIO_method;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void ma_tls_set_error(MYSQL *mysql)
|
static void ma_tls_set_error(MYSQL *mysql)
|
||||||
@@ -158,7 +160,7 @@ MA_SSL_SESSION *ma_tls_get_session(MYSQL *mysql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_USE_BIOMETHOD
|
||||||
static int ma_bio_read(BIO *bio, char *buf, int size)
|
static int ma_bio_read(BIO *bio, char *buf, int size)
|
||||||
{
|
{
|
||||||
MARIADB_PVIO *pvio= (MARIADB_PVIO *)bio->ptr;
|
MARIADB_PVIO *pvio= (MARIADB_PVIO *)bio->ptr;
|
||||||
@@ -331,7 +333,7 @@ int ma_tls_start(char *errmsg, size_t errmsg_len)
|
|||||||
SSL_CTX_sess_set_remove_cb(SSL_context, ma_tls_remove_session_cb);
|
SSL_CTX_sess_set_remove_cb(SSL_context, ma_tls_remove_session_cb);
|
||||||
#endif
|
#endif
|
||||||
disable_sigpipe();
|
disable_sigpipe();
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_USE_BIOMETHOD
|
||||||
memcpy(&ma_BIO_method, BIO_s_socket(), sizeof(BIO_METHOD));
|
memcpy(&ma_BIO_method, BIO_s_socket(), sizeof(BIO_METHOD));
|
||||||
ma_BIO_method.bread= ma_bio_read;
|
ma_BIO_method.bread= ma_bio_read;
|
||||||
ma_BIO_method.bwrite= ma_bio_write;
|
ma_BIO_method.bwrite= ma_bio_write;
|
||||||
@@ -524,7 +526,7 @@ my_bool ma_tls_connect(MARIADB_TLS *ctls)
|
|||||||
MYSQL *mysql;
|
MYSQL *mysql;
|
||||||
MARIADB_PVIO *pvio;
|
MARIADB_PVIO *pvio;
|
||||||
int rc;
|
int rc;
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_USE_BIOMETHOD
|
||||||
BIO_METHOD *bio_method= NULL;
|
BIO_METHOD *bio_method= NULL;
|
||||||
BIO *bio;
|
BIO *bio;
|
||||||
#endif
|
#endif
|
||||||
@@ -538,7 +540,7 @@ my_bool ma_tls_connect(MARIADB_TLS *ctls)
|
|||||||
|
|
||||||
SSL_clear(ssl);
|
SSL_clear(ssl);
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_USE_BIOMETHOD
|
||||||
bio= BIO_new(&ma_BIO_method);
|
bio= BIO_new(&ma_BIO_method);
|
||||||
bio->ptr= pvio;
|
bio->ptr= pvio;
|
||||||
SSL_set_bio(ssl, bio, bio);
|
SSL_set_bio(ssl, bio, bio);
|
||||||
|
Reference in New Issue
Block a user