From fecedb8c92bc93c044e3f8b52a304ad2cb14ecf1 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Wed, 5 Dec 2018 17:36:34 +0100 Subject: Windows fixes --- include/violite.h | 10 +++++++++- sql/sys_vars.cc | 9 +-------- vio/viosslfactories.c | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/violite.h b/include/violite.h index 182c80d04c2..6d9b7550511 100644 --- a/include/violite.h +++ b/include/violite.h @@ -53,8 +53,16 @@ enum enum_vio_io_event #define VIO_TLSv1_0 1 #define VIO_TLSv1_1 2 +#ifdef TLS1_2_VERSION #define VIO_TLSv1_2 4 +#else +#define VIO_TLSv1_2 0 +#endif +#ifdef TLS1_3_VERSION #define VIO_TLSv1_3 8 +#else +#define VIO_TLSv1_3 0 +#endif #define VIO_LOCALHOST 1U /* a localhost connection */ #define VIO_BUFFERED_READ 2U /* use buffered read */ @@ -171,7 +179,7 @@ struct st_VioSSLFd const char *ca_file,const char *ca_path, const char *cipher, enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path, - long tls_version); + ulonglong tls_version); void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd); #endif /* HAVE_OPENSSL */ diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 4b8e6eca8b8..d1b49c51718 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3222,14 +3222,7 @@ static Sys_var_set Sys_tls_version( "TLS protocol version for secure connections.", READ_ONLY GLOBAL_VAR(tls_version), CMD_LINE(REQUIRED_ARG), tls_version_names, - DEFAULT(VIO_TLSv1_0 | VIO_TLSv1_1 -#ifdef TLS1_2_VERSION - | VIO_TLSv1_2 -#endif -#ifdef TLS1_3_VERSION - | VIO_TLSv1_3 -#endif - )); + DEFAULT(VIO_TLSv1_0 | VIO_TLSv1_1 | VIO_TLSv1_2 | VIO_TLSv1_3)); static Sys_var_mybool Sys_standard_compliant_cte( "standard_compliant_cte", diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 9ea90dccd10..7d4c5c9e334 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -167,7 +167,7 @@ static void check_ssl_init() } } -static long vio_tls_protocol_options(long tls_version) +static long vio_tls_protocol_options(ulonglong tls_version) { long tls_protocol_flags= #ifdef TLS1_3_VERSION @@ -214,7 +214,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, const char *cipher, my_bool is_client_method, enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path, - long tls_version) + ulonglong tls_version) { DH *dh; struct st_VioSSLFd *ssl_fd; @@ -386,7 +386,7 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, const char *ca_file, const char *ca_path, const char *cipher, enum enum_ssl_init_error* error, const char *crl_file, const char *crl_path, - long tls_version) + ulonglong tls_version) { struct st_VioSSLFd *ssl_fd; int verify= SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE; -- cgit v1.2.1