diff options
Diffstat (limited to 'dev-db/mysql-connector-c/files')
-rw-r--r-- | dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-always-build-decompress-utilities.patch | 22 | ||||
-rw-r--r-- | dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-do-not-install-comp_err.patch | 12 | ||||
-rw-r--r-- | dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-libressl.patch (renamed from dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-libressl.patch) | 223 |
3 files changed, 143 insertions, 114 deletions
diff --git a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-always-build-decompress-utilities.patch b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-always-build-decompress-utilities.patch deleted file mode 100644 index 927662705aa3..000000000000 --- a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-always-build-decompress-utilities.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/utilities/CMakeLists.txt -+++ b/utilities/CMakeLists.txt -@@ -101,15 +101,11 @@ MYSQL_ADD_EXECUTABLE(perror perror.cc) - ADD_DEPENDENCIES(perror GenError) - TARGET_LINK_LIBRARIES(perror mysys) - --IF (BUILD_BUNDLED_LZ4) -- MYSQL_ADD_EXECUTABLE(lz4_decompress lz4_decompress.cc) -- TARGET_LINK_LIBRARIES(lz4_decompress ${LZ4_LIBRARY} mysys) --ENDIF() -+MYSQL_ADD_EXECUTABLE(lz4_decompress lz4_decompress.cc) -+TARGET_LINK_LIBRARIES(lz4_decompress ${LZ4_LIBRARY} mysys) - --IF (BUILD_BUNDLED_ZLIB OR NOT OPENSSL_EXECUTABLE_HAS_ZLIB) -- MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc) -- TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY} mysys) --ENDIF() -+MYSQL_ADD_EXECUTABLE(zlib_decompress zlib_decompress.cc) -+TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY} mysys) - - IF(WITH_INNOBASE_STORAGE_ENGINE) - diff --git a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-do-not-install-comp_err.patch b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-do-not-install-comp_err.patch new file mode 100644 index 000000000000..94329eeeb3c7 --- /dev/null +++ b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-do-not-install-comp_err.patch @@ -0,0 +1,12 @@ +diff --git a/utilities/CMakeLists.txt b/utilities/CMakeLists.txt +index c855f8ab..0ebef451 100644 +--- a/utilities/CMakeLists.txt ++++ b/utilities/CMakeLists.txt +@@ -27,6 +27,7 @@ IF(NOT CMAKE_CROSSCOMPILING) + comp_err.cc + COMPONENT Server + LINK_LIBRARIES mysys ++ SKIP_INSTALL + ) + ENDIF() + diff --git a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-libressl.patch b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-libressl.patch index 340f894a895f..1fc949ae8564 100644 --- a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.17-libressl.patch +++ b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.19-libressl.patch @@ -1,17 +1,6 @@ -From: Stefan Strogin <steils@gentoo.org> -Date: Sat, 8 Jun 2019 15:52:26 +0300 -Subject: [PATCH] Fix build with LibreSSL - -- Fix version checks as OPENSSL_VERSION_NUMBER in OpenSSL is always - 0x20000000L. -- FIPS support is removed from LibreSSL, do not use it. -- Check for TLS1_3_VERSION define, not OpenSSL/LibreSSL version. - Theoretically even OpenSSL >=1.1.1 can be built with TLS 1.3 disabled. - - --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake -@@ -304,13 +304,14 @@ MACRO (MYSQL_CHECK_SSL) +@@ -229,13 +229,14 @@ MACRO (MYSQL_CHECK_SSL) OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}" ) ENDIF() @@ -28,76 +17,91 @@ Subject: [PATCH] Fix build with LibreSSL ) SET(OPENSSL_FOUND TRUE) FIND_PROGRAM(OPENSSL_EXECUTABLE openssl ---- a/extra/libevent/openssl-compat.h -+++ b/extra/libevent/openssl-compat.h -@@ -24,7 +24,6 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name) - #define BIO_set_init(b, val) (b)->init = (val) - #define BIO_set_data(b, val) (b)->ptr = (val) - #define BIO_set_shutdown(b, val) (b)->shutdown = (val) --#define BIO_get_init(b) (b)->init - #define BIO_get_data(b) (b)->ptr - #define BIO_get_shutdown(b) (b)->shutdown - -@@ -32,4 +31,8 @@ static inline BIO_METHOD *BIO_meth_new(int type, const char *name) - - #endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -+#define BIO_get_init(b) (b)->init -+#endif -+ - #endif /* OPENSSL_COMPAT_H */ --- a/mysys/my_md5.cc +++ b/mysys/my_md5.cc -@@ -56,7 +56,7 @@ static void my_md5_hash(unsigned char *digest, unsigned const char *buf, +@@ -56,7 +56,9 @@ static void my_md5_hash(unsigned char *digest, unsigned const char *buf, int compute_md5_hash(char *digest, const char *buf, int len) { int retval = 0; int fips_mode = 0; --#if !defined(HAVE_WOLFSSL) -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER fips_mode = FIPS_mode(); - #endif /* HAVE_WOLFSSL */ ++#endif /* If fips mode is ON/STRICT restricted method calls will result into abort, + * skipping call. */ + if (fips_mode == 0) { --- a/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c +++ b/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c -@@ -297,7 +297,7 @@ error: +@@ -329,6 +329,7 @@ error: return 1; } --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER #define OPENSSL_ERROR_LENGTH 512 static int configure_ssl_fips_mode(const uint fips_mode) { int rc = -1; -@@ -521,7 +521,7 @@ int xcom_init_ssl(const char *server_key_file, const char *server_cert_file, +@@ -352,6 +353,7 @@ static int configure_ssl_fips_mode(const uint fips_mode) { + EXIT: + return rc; + } ++#endif + + static int configure_ssl_ca(SSL_CTX *ssl_ctx, const char *ca_file, + const char *ca_path) { +@@ -555,10 +557,12 @@ int xcom_init_ssl(const char *server_key_file, const char *server_cert_file, int verify_server = SSL_VERIFY_NONE; int verify_client = SSL_VERIFY_NONE; --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER if (configure_ssl_fips_mode(ssl_fips_mode) != 1) { G_ERROR("Error setting the ssl fips mode"); goto error; + } ++#endif + + SSL_library_init(); + SSL_load_error_strings(); +@@ -622,7 +626,7 @@ error: + void xcom_cleanup_ssl() { + if (!xcom_use_ssl()) return; + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + ERR_remove_thread_state(0); + #endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + } --- a/plugin/x/client/xconnection_impl.cc +++ b/plugin/x/client/xconnection_impl.cc -@@ -523,7 +523,7 @@ XError Connection_impl::get_ssl_error(const int error_id) { +@@ -520,6 +520,7 @@ XError Connection_impl::get_ssl_error(const int error_id) { return XError(CR_SSL_CONNECTION_ERROR, buffer); } --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER /** Set fips mode in openssl library, When we set fips mode ON/STRICT, it will perform following operations: -@@ -573,7 +573,7 @@ XError Connection_impl::activate_tls() { +@@ -559,6 +560,7 @@ int set_fips_mode(const uint32_t fips_mode, + EXIT: + return rc; + } ++#endif + + XError Connection_impl::activate_tls() { + if (nullptr == m_vio) return get_socket_error(SOCKET_ECONNRESET); +@@ -569,12 +571,14 @@ XError Connection_impl::activate_tls() { if (!m_context->m_ssl_config.is_configured()) - return XError{CR_SSL_CONNECTION_ERROR, ER_TEXT_TLS_NOT_CONFIGURATED}; + return XError{CR_SSL_CONNECTION_ERROR, ER_TEXT_TLS_NOT_CONFIGURATED, true}; --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER char err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; - if (set_fips_mode((int)m_context->m_ssl_config.m_ssl_fips_mode, err_string) != - 1) { + if (set_fips_mode( + static_cast<uint32_t>(m_context->m_ssl_config.m_ssl_fips_mode), + err_string) != 1) { + return XError{CR_SSL_CONNECTION_ERROR, err_string, true}; + } ++#endif + auto ssl_ctx_flags = process_tls_version( + details::null_when_empty(m_context->m_ssl_config.m_tls_version)); + --- a/router/src/http/src/tls_client_context.cc +++ b/router/src/http/src/tls_client_context.cc @@ -54,7 +54,7 @@ void TlsClientContext::verify(TlsVerify verify) { @@ -111,7 +115,7 @@ Subject: [PATCH] Fix build with LibreSSL } --- a/router/src/http/src/tls_context.cc +++ b/router/src/http/src/tls_context.cc -@@ -93,7 +93,7 @@ static constexpr int o11x_version(TlsVersion version) { +@@ -91,7 +91,7 @@ static int o11x_version(TlsVersion version) { return TLS1_1_VERSION; case TlsVersion::TLS_1_2: return TLS1_2_VERSION; @@ -120,19 +124,19 @@ Subject: [PATCH] Fix build with LibreSSL case TlsVersion::TLS_1_3: return TLS1_3_VERSION; #endif -@@ -123,9 +123,11 @@ void TlsContext::version_range(TlsVersion min_version, TlsVersion max_version) { +@@ -120,9 +120,11 @@ void TlsContext::version_range(TlsVersion min_version, TlsVersion max_version) { + switch (min_version) { default: // unknown, leave all disabled - // fallthrough +#ifdef TLS1_3_VERSION + // fallthrough case TlsVersion::TLS_1_3: opts |= SSL_OP_NO_TLSv1_2; - // fallthrough +#endif + // fallthrough case TlsVersion::TLS_1_2: opts |= SSL_OP_NO_TLSv1_1; - // fallthrough -@@ -172,8 +174,10 @@ TlsVersion TlsContext::min_version() const { +@@ -170,8 +172,10 @@ TlsVersion TlsContext::min_version() const { return TlsVersion::TLS_1_1; case TLS1_2_VERSION: return TlsVersion::TLS_1_2; @@ -143,9 +147,19 @@ Subject: [PATCH] Fix build with LibreSSL case 0: return TlsVersion::AUTO; default: +@@ -230,7 +234,8 @@ TlsContext::InfoCallback TlsContext::info_callback() const { + } + + int TlsContext::security_level() const { +-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) ++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \ ++ !defined(LIBRESSL_VERSION_NUMBER) + return SSL_CTX_get_security_level(ssl_ctx_.get()); + #else + return 0; --- a/router/src/http/src/tls_server_context.cc +++ b/router/src/http/src/tls_server_context.cc -@@ -170,7 +170,8 @@ void TlsServerContext::init_tmp_dh(const std::string &dh_params) { +@@ -166,7 +166,8 @@ void TlsServerContext::init_tmp_dh(const std::string &dh_params) { } } else { @@ -157,19 +171,18 @@ Subject: [PATCH] Fix build with LibreSSL /* --- a/sql-common/client.cc +++ b/sql-common/client.cc -@@ -7602,7 +7602,8 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option, +@@ -7730,7 +7730,7 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option, #endif break; case MYSQL_OPT_SSL_FIPS_MODE: { --#if defined(HAVE_OPENSSL) && !defined(HAVE_WOLFSSL) -+#if defined(HAVE_OPENSSL) && \ -+ !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) +-#if defined(HAVE_OPENSSL) ++#if defined(HAVE_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER) char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; ENSURE_EXTENSIONS_PRESENT(&mysql->options); mysql->options.extension->ssl_fips_mode = *static_cast<const uint *>(arg); --- a/sql/mysqld.cc +++ b/sql/mysqld.cc -@@ -4795,7 +4795,7 @@ static int init_thread_environment() { +@@ -4818,7 +4818,7 @@ static int init_thread_environment() { static PSI_memory_key key_memory_openssl = PSI_NOT_INSTRUMENTED; @@ -178,57 +191,76 @@ Subject: [PATCH] Fix build with LibreSSL #define FILE_LINE_ARGS #else #define FILE_LINE_ARGS , const char *, int -@@ -4831,7 +4831,7 @@ static void init_ssl() { +@@ -4854,12 +4854,14 @@ static void init_ssl() { } static int init_ssl_communication() { --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; int ret_fips_mode = set_fips_mode(opt_ssl_fips_mode, ssl_err_string); if (ret_fips_mode != 1) { + LogErr(ERROR_LEVEL, ER_SSL_FIPS_MODE_ERROR, ssl_err_string); + return 1; + } ++#endif + if (SslAcceptorContext::singleton_init(opt_use_ssl)) return 1; + + #if OPENSSL_VERSION_NUMBER < 0x10100000L --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc -@@ -4377,7 +4377,7 @@ static Sys_var_ulong Sys_max_execution_time( +@@ -4417,6 +4417,7 @@ static Sys_var_ulong Sys_max_execution_time( HINT_UPDATEABLE SESSION_VAR(max_execution_time), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1)); --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER static bool update_fips_mode(sys_var *, THD *, enum_var_type) { char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; if (set_fips_mode(opt_ssl_fips_mode, ssl_err_string) != 1) { -@@ -4390,7 +4390,7 @@ static bool update_fips_mode(sys_var *, THD *, enum_var_type) { +@@ -4427,15 +4428,30 @@ static bool update_fips_mode(sys_var *, THD *, enum_var_type) { + return false; + } } - #endif ++#endif --#ifdef HAVE_WOLFSSL -+#if defined(HAVE_WOLFSSL) || defined(LIBRESSL_VERSION_NUMBER) - static const char *ssl_fips_mode_names[] = {"OFF", 0}; - #else ++#if defined(LIBRESSL_VERSION_NUMBER) ++static const char *ssl_fips_mode_names[] = {"OFF", 0}; ++#else static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0}; -@@ -4398,7 +4398,7 @@ static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0}; ++#endif static Sys_var_enum Sys_ssl_fips_mode( "ssl_fips_mode", "SSL FIPS mode (applies only for OpenSSL); " --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER "permitted values are: OFF, ON, STRICT", - #else - "permitted values are: OFF", -@@ -4406,7 +4406,7 @@ static Sys_var_enum Sys_ssl_fips_mode( ++#else ++ "permitted values are: OFF", ++#endif GLOBAL_VAR(opt_ssl_fips_mode), CMD_LINE(REQUIRED_ARG, OPT_SSL_FIPS_MODE), ssl_fips_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, - ON_CHECK(NULL), --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) - ON_UPDATE(update_fips_mode), - #else - ON_UPDATE(NULL), +- ON_CHECK(NULL), ON_UPDATE(update_fips_mode), NULL); ++ ON_CHECK(NULL), ++#ifndef LIBRESSL_VERSION_NUMBER ++ ON_UPDATE(update_fips_mode), ++#else ++ ON_UPDATE(NULL), ++#endif ++ NULL); + + #if defined(HAVE_OPENSSL) + static Sys_var_bool Sys_auto_generate_certs( --- a/vio/viossl.cc +++ b/vio/viossl.cc -@@ -507,7 +507,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, - #if !defined(HAVE_WOLFSSL) && !defined(DBUG_OFF) +@@ -45,7 +45,7 @@ + BIO_set_callback_ex was added in openSSL 1.1.1 + For older openSSL, use the deprecated BIO_set_callback. + */ +-#if OPENSSL_VERSION_NUMBER >= 0x10101000L ++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER) + #define HAVE_BIO_SET_CALLBACK_EX + #endif + +@@ -637,7 +637,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, + #if !defined(DBUG_OFF) { STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; - ssl_comp_methods = SSL_COMP_get_compression_methods(); @@ -236,7 +268,7 @@ Subject: [PATCH] Fix build with LibreSSL n = sk_SSL_COMP_num(ssl_comp_methods); DBUG_PRINT("info", ("Available compression methods:\n")); if (n == 0) -@@ -515,7 +515,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, +@@ -645,7 +645,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, else for (j = 0; j < n; j++) { SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j); @@ -247,12 +279,19 @@ Subject: [PATCH] Fix build with LibreSSL DBUG_PRINT("info", --- a/vio/viosslfactories.cc +++ b/vio/viosslfactories.cc -@@ -429,7 +429,7 @@ void ssl_start() { +@@ -420,6 +420,7 @@ void ssl_start() { } } --#ifndef HAVE_WOLFSSL -+#if !defined(HAVE_WOLFSSL) && !defined(LIBRESSL_VERSION_NUMBER) ++#ifndef LIBRESSL_VERSION_NUMBER /** Set fips mode in openssl library, When we set fips mode ON/STRICT, it will perform following operations: +@@ -473,6 +474,7 @@ EXIT: + @returns openssl current fips mode + */ + uint get_fips_mode() { return FIPS_mode(); } ++#endif + + long process_tls_version(const char *tls_version) { + const char *separator = ","; |