diff options
Diffstat (limited to 'databases/mysql56-client/patches')
9 files changed, 307 insertions, 19 deletions
diff --git a/databases/mysql56-client/patches/patch-include_m__string.h b/databases/mysql56-client/patches/patch-include_m__string.h new file mode 100644 index 00000000000..c5b4827b9a7 --- /dev/null +++ b/databases/mysql56-client/patches/patch-include_m__string.h @@ -0,0 +1,16 @@ +$NetBSD: patch-include_m__string.h,v 1.1.2.2 2019/09/08 16:55:17 bsiegert Exp $ + +* Stop useless warnings. + +--- include/m_string.h.orig 2019-06-10 10:25:32.000000000 +0000 ++++ include/m_string.h +@@ -43,7 +43,9 @@ + #endif + + #define bfill please_use_memset_rather_than_bfill() ++#ifndef bzero + #define bzero please_use_memset_rather_than_bzero() ++#endif + + #if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE) + # define memcpy(d, s, n) bcopy ((s), (d), (n)) diff --git a/databases/mysql56-client/patches/patch-include_my_net.h b/databases/mysql56-client/patches/patch-include_my_net.h index 63e45c2df9e..3341ec72da5 100644 --- a/databases/mysql56-client/patches/patch-include_my_net.h +++ b/databases/mysql56-client/patches/patch-include_my_net.h @@ -1,10 +1,11 @@ -$NetBSD: patch-include_my_net.h,v 1.1 2013/02/13 21:00:04 adam Exp $ +$NetBSD: patch-include_my_net.h,v 1.1.54.1 2019/09/08 16:55:18 bsiegert Exp $ -Define SHUT_RDWR for Irix 5. +* Define SHUT_RDWR for Irix 5. +* Stop useless warnings. ---- include/my_net.h.orig 2013-01-22 16:54:49.000000000 +0000 +--- include/my_net.h.orig 2019-06-10 10:25:32.000000000 +0000 +++ include/my_net.h -@@ -70,6 +70,15 @@ C_MODE_START +@@ -70,14 +70,25 @@ C_MODE_START #include <netdb.h> /* getaddrinfo() & co */ #endif @@ -20,3 +21,13 @@ Define SHUT_RDWR for Irix 5. /* On OSes which don't have the in_addr_t, we guess that using uint32 is the best possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD64bit + & Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too. + */ + #ifndef HAVE_IN_ADDR_T ++#ifndef in_addr_t + #define in_addr_t uint32 + #endif ++#endif + + + C_MODE_END diff --git a/databases/mysql56-client/patches/patch-mysys__ssl_my__aes__openssl.cc b/databases/mysql56-client/patches/patch-mysys__ssl_my__aes__openssl.cc new file mode 100644 index 00000000000..d7f03333664 --- /dev/null +++ b/databases/mysql56-client/patches/patch-mysys__ssl_my__aes__openssl.cc @@ -0,0 +1,118 @@ +$NetBSD: patch-mysys__ssl_my__aes__openssl.cc,v 1.1.2.2 2019/09/08 16:55:18 bsiegert Exp $ + +* Allow build with OpenSSL 1.1. + +--- mysys_ssl/my_aes_openssl.cc.orig 2019-06-10 10:25:32.000000000 +0000 ++++ mysys_ssl/my_aes_openssl.cc +@@ -108,33 +108,46 @@ int my_aes_encrypt(const unsigned char * + const unsigned char *key, uint32 key_length, + enum my_aes_opmode mode, const unsigned char *iv) + { +- EVP_CIPHER_CTX ctx; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX stack_ctx; ++ EVP_CIPHER_CTX *ctx= &stack_ctx; ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX *ctx= EVP_CIPHER_CTX_new(); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + const EVP_CIPHER *cipher= aes_evp_type(mode); + int u_len, f_len; + /* The real key to be used for encryption */ + unsigned char rkey[MAX_AES_KEY_LENGTH / 8]; + my_aes_create_key(key, key_length, rkey, mode); + +- if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) ++ if (!ctx || !cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) + return MY_AES_BAD_DATA; + +- if (!EVP_EncryptInit(&ctx, cipher, rkey, iv)) ++ if (!EVP_EncryptInit(ctx, cipher, rkey, iv)) + goto aes_error; /* Error */ +- if (!EVP_CIPHER_CTX_set_padding(&ctx, 1)) ++ if (!EVP_CIPHER_CTX_set_padding(ctx, 1)) + goto aes_error; /* Error */ +- if (!EVP_EncryptUpdate(&ctx, dest, &u_len, source, source_length)) ++ if (!EVP_EncryptUpdate(ctx, dest, &u_len, source, source_length)) + goto aes_error; /* Error */ + +- if (!EVP_EncryptFinal(&ctx, dest + u_len, &f_len)) ++ if (!EVP_EncryptFinal(ctx, dest + u_len, &f_len)) + goto aes_error; /* Error */ + +- EVP_CIPHER_CTX_cleanup(&ctx); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_cleanup(ctx); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX_free(ctx); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + return u_len + f_len; + + aes_error: + /* need to explicitly clean up the error if we want to ignore it */ + ERR_clear_error(); +- EVP_CIPHER_CTX_cleanup(&ctx); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_cleanup(ctx); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX_free(ctx); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + return MY_AES_BAD_DATA; + } + +@@ -145,7 +158,12 @@ int my_aes_decrypt(const unsigned char * + enum my_aes_opmode mode, const unsigned char *iv) + { + +- EVP_CIPHER_CTX ctx; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX stack_ctx; ++ EVP_CIPHER_CTX *ctx= &stack_ctx; ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX *ctx= EVP_CIPHER_CTX_new(); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + const EVP_CIPHER *cipher= aes_evp_type(mode); + int u_len, f_len; + +@@ -153,27 +171,33 @@ int my_aes_decrypt(const unsigned char * + unsigned char rkey[MAX_AES_KEY_LENGTH / 8]; + + my_aes_create_key(key, key_length, rkey, mode); +- if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) ++ if (!ctx || !cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) + return MY_AES_BAD_DATA; + +- EVP_CIPHER_CTX_init(&ctx); +- +- if (!EVP_DecryptInit(&ctx, aes_evp_type(mode), rkey, iv)) ++ if (!EVP_DecryptInit(ctx, aes_evp_type(mode), rkey, iv)) + goto aes_error; /* Error */ +- if (!EVP_CIPHER_CTX_set_padding(&ctx, 1)) ++ if (!EVP_CIPHER_CTX_set_padding(ctx, 1)) + goto aes_error; /* Error */ +- if (!EVP_DecryptUpdate(&ctx, dest, &u_len, source, source_length)) ++ if (!EVP_DecryptUpdate(ctx, dest, &u_len, source, source_length)) + goto aes_error; /* Error */ +- if (!EVP_DecryptFinal_ex(&ctx, dest + u_len, &f_len)) ++ if (!EVP_DecryptFinal_ex(ctx, dest + u_len, &f_len)) + goto aes_error; /* Error */ + +- EVP_CIPHER_CTX_cleanup(&ctx); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_cleanup(ctx); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX_free(ctx); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + return u_len + f_len; + + aes_error: + /* need to explicitly clean up the error if we want to ignore it */ + ERR_clear_error(); +- EVP_CIPHER_CTX_cleanup(&ctx); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_cleanup(ctx); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX_free(ctx); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + return MY_AES_BAD_DATA; + } + diff --git a/databases/mysql56-client/patches/patch-sql-common_client__authentication.cc b/databases/mysql56-client/patches/patch-sql-common_client__authentication.cc deleted file mode 100644 index 7d76fd4d24f..00000000000 --- a/databases/mysql56-client/patches/patch-sql-common_client__authentication.cc +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-sql-common_client__authentication.cc,v 1.1 2018/02/05 16:09:52 jperkin Exp $ - -Backport upstream fix. - ---- sql-common/client_authentication.cc.orig 2017-12-09 07:33:37.000000000 +0000 -+++ sql-common/client_authentication.cc -@@ -84,7 +84,7 @@ RSA *rsa_init(MYSQL *mysql) - - if (mysql->options.extension != NULL && - mysql->options.extension->server_public_key_path != NULL && -- mysql->options.extension->server_public_key_path != '\0') -+ mysql->options.extension->server_public_key_path[0] != '\0') - { - pub_key_file= fopen(mysql->options.extension->server_public_key_path, - "r"); diff --git a/databases/mysql56-client/patches/patch-sql_mysqld.cc b/databases/mysql56-client/patches/patch-sql_mysqld.cc new file mode 100644 index 00000000000..65c63a87898 --- /dev/null +++ b/databases/mysql56-client/patches/patch-sql_mysqld.cc @@ -0,0 +1,42 @@ +$NetBSD: patch-sql_mysqld.cc,v 1.5.2.2 2019/09/08 16:55:18 bsiegert Exp $ + +* Allow build with OpenSSL 1.1. + +--- sql/mysqld.cc.orig 2019-06-10 10:25:32.000000000 +0000 ++++ sql/mysqld.cc +@@ -2759,9 +2759,9 @@ bool one_thread_per_connection_end(THD * + } + + // Clean up errors now, before possibly waiting for a new connection. +-#ifndef EMBEDDED_LIBRARY +- ERR_remove_state(0); +-#endif ++#if !defined(EMBEDDED_LIBRARY) && OPENSSL_VERSION_NUMBER < 0x10100000L ++ ERR_remove_thread_state(0); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + + delete thd; + +@@ -4358,7 +4358,11 @@ static int init_ssl() + { + #ifdef HAVE_OPENSSL + #ifndef HAVE_YASSL ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + CRYPTO_malloc_init(); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ OPENSSL_malloc_init(); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + #endif + ssl_start(); + #ifndef EMBEDDED_LIBRARY +@@ -4372,7 +4376,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)); +- ERR_remove_state(0); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ ERR_remove_thread_state(0); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + if (!ssl_acceptor_fd) + { + sql_print_warning("Failed to setup SSL"); diff --git a/databases/mysql56-client/patches/patch-sql_rpl__slave.cc b/databases/mysql56-client/patches/patch-sql_rpl__slave.cc new file mode 100644 index 00000000000..71c51e96fd6 --- /dev/null +++ b/databases/mysql56-client/patches/patch-sql_rpl__slave.cc @@ -0,0 +1,39 @@ +$NetBSD: patch-sql_rpl__slave.cc,v 1.3.2.2 2019/09/08 16:55:18 bsiegert Exp $ + +* Allow build with OpenSSL 1.1. + +--- sql/rpl_slave.cc.orig 2019-06-10 10:25:32.000000000 +0000 ++++ sql/rpl_slave.cc +@@ -5143,7 +5143,9 @@ err: + mysql_mutex_unlock(&mi->run_lock); + DBUG_LEAVE; // Must match DBUG_ENTER() + my_thread_end(); +- ERR_remove_state(0); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ ERR_remove_thread_state(0); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + pthread_exit(0); + return(0); // Avoid compiler warnings + } +@@ -5334,7 +5336,9 @@ err: + } + + my_thread_end(); +- ERR_remove_state(0); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ ERR_remove_thread_state(0); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + pthread_exit(0); + DBUG_RETURN(0); + } +@@ -6482,7 +6486,9 @@ log '%s' at position %s, relay log '%s' + + DBUG_LEAVE; // Must match DBUG_ENTER() + my_thread_end(); +- ERR_remove_state(0); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ ERR_remove_thread_state(0); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + pthread_exit(0); + return 0; // Avoid compiler warnings + } diff --git a/databases/mysql56-client/patches/patch-storage_innobase_include_univ.i b/databases/mysql56-client/patches/patch-storage_innobase_include_univ.i new file mode 100644 index 00000000000..823ec28be69 --- /dev/null +++ b/databases/mysql56-client/patches/patch-storage_innobase_include_univ.i @@ -0,0 +1,16 @@ +$NetBSD: patch-storage_innobase_include_univ.i,v 1.1.2.2 2019/09/08 16:55:18 bsiegert Exp $ + +* Stop another useless warnings. + +--- storage/innobase/include/univ.i.orig 2019-06-10 10:25:32.000000000 +0000 ++++ storage/innobase/include/univ.i +@@ -123,7 +123,9 @@ Sun Studio */ + #endif /* #if (defined(WIN32) || ... */ + + #ifndef __WIN__ ++#ifndef __STDC_FORMAT_MACROS + #define __STDC_FORMAT_MACROS /* Enable C99 printf format macros */ ++#endif + #include <inttypes.h> + #endif /* !__WIN__ */ + diff --git a/databases/mysql56-client/patches/patch-vio_vio.c b/databases/mysql56-client/patches/patch-vio_vio.c new file mode 100644 index 00000000000..63d8c29cc98 --- /dev/null +++ b/databases/mysql56-client/patches/patch-vio_vio.c @@ -0,0 +1,17 @@ +$NetBSD: patch-vio_vio.c,v 1.3.2.2 2019/09/08 16:55:18 bsiegert Exp $ + +* Allow build with OpenSSL 1.1. + +--- vio/vio.c.orig 2019-06-10 10:25:32.000000000 +0000 ++++ vio/vio.c +@@ -384,7 +384,9 @@ void vio_end(void) + yaSSL_CleanUp(); + #elif defined(HAVE_OPENSSL) + // This one is needed on the client side +- ERR_remove_state(0); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ ERR_remove_thread_state(0); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + ERR_free_strings(); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); diff --git a/databases/mysql56-client/patches/patch-vio_viosslfactories.c b/databases/mysql56-client/patches/patch-vio_viosslfactories.c new file mode 100644 index 00000000000..148b9f83485 --- /dev/null +++ b/databases/mysql56-client/patches/patch-vio_viosslfactories.c @@ -0,0 +1,44 @@ +$NetBSD: patch-vio_viosslfactories.c,v 1.3.2.2 2019/09/08 16:55:18 bsiegert Exp $ + +* Allow build with OpenSSL 1.1. + +--- vio/viosslfactories.c.orig 2019-06-10 10:25:32.000000000 +0000 ++++ vio/viosslfactories.c +@@ -68,13 +68,21 @@ 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); +- if (! dh->p || ! dh->g) +- { ++ BIGNUM *p= BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL); ++ BIGNUM *g= BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL); ++ if (!p || !g ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++ || !DH_set0_pqg(dh, p, NULL, g) ++#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ ++ ) { ++ /* DH_free() will free 'p' and 'g' at once. */ + DH_free(dh); +- dh=0; ++ return NULL; + } ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ dh->p= p; ++ dh->g= g; ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + } + return(dh); + } +@@ -230,8 +238,8 @@ new_VioSSLFd(const char *key_file, const + DBUG_RETURN(0); + + if (!(ssl_fd->ssl_context= SSL_CTX_new(is_client ? +- TLSv1_client_method() : +- TLSv1_server_method()))) ++ SSLv23_client_method() : ++ SSLv23_server_method()))) + { + *error= SSL_INITERR_MEMFAIL; + DBUG_PRINT("error", ("%s", sslGetErrString(*error))); |