From d39d694e00c32933328ae2cf091c7ddb98a669f2 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Tue, 4 Jun 2019 13:09:09 +0200 Subject: Add LibreSSL patches for MySQL 5.6 Signed-off-by: Thomas Deutschmann --- 20018_all_mysql-5.6.44-fix-libressl-support.patch | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 20018_all_mysql-5.6.44-fix-libressl-support.patch diff --git a/20018_all_mysql-5.6.44-fix-libressl-support.patch b/20018_all_mysql-5.6.44-fix-libressl-support.patch new file mode 100644 index 0000000..b180677 --- /dev/null +++ b/20018_all_mysql-5.6.44-fix-libressl-support.patch @@ -0,0 +1,47 @@ +--- a/sql/mysqld.cc ++++ b/sql/mysqld.cc +@@ -4358,7 +4358,10 @@ static int init_ssl() + { + #ifdef HAVE_OPENSSL + #ifndef HAVE_YASSL ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + CRYPTO_malloc_init(); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ OPENSSL_malloc_init(); + #endif + ssl_start(); + #ifndef EMBEDDED_LIBRARY +@@ -4372,7 +4375,9 @@ static int init_ssl() + opt_ssl_cipher, &error, + opt_ssl_crl, opt_ssl_crlpath); + DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd)); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + ERR_remove_state(0); ++#endif + if (!ssl_acceptor_fd) + { + sql_print_warning("Failed to setup SSL"); +--- a/vio/viosslfactories.c ++++ b/vio/viosslfactories.c +@@ -68,12 +68,18 @@ static DH *get_dh2048(void) + DH *dh; + if ((dh=DH_new())) + { +- dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); +- dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL); ++ BIGNUM* p= BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); ++ BIGNUM* g= BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) ++ dh->p= p; ++ dh->g= g; + if (! dh->p || ! dh->g) ++#else ++ if (!DH_set0_pqg(dh, p, NULL, g)) ++#endif + { + DH_free(dh); +- dh=0; ++ dh= NULL; + } + } + return(dh); -- cgit v1.2.3-65-gdbad