commit:     d39d694e00c32933328ae2cf091c7ddb98a669f2
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  4 11:09:09 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Jun  4 11:09:09 2019 +0000
URL:        https://gitweb.gentoo.org/proj/mysql-extras.git/commit/?id=d39d694e

Add LibreSSL patches for MySQL 5.6

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 20018_all_mysql-5.6.44-fix-libressl-support.patch | 47 +++++++++++++++++++++++
 1 file changed, 47 insertions(+)

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);

Reply via email to