In file included from /usr/obj/usr/ports/databases/mysql57-client/work/mysql-5.7.30/vio/viosslfactories.c:29:

/usr/obj/usr/ports/databases/mysql57-client/work/mysql-5.7.30/include/my_openssl.h:55:30: error: use of undeclared identifier 'OPENSSL_INIT_NO_ATEXIT'
  return OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL);

This fix a problem with libressl

PR:		246070
MFH:		2020Q2
Sponsored by:	Netzkommune GmbH
This commit is contained in:
Jochen Neumeister 2020-05-04 09:44:07 +00:00
parent 8d8b84abb6
commit 83a7644990
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=533909
8 changed files with 128 additions and 1 deletions

View File

@ -0,0 +1,11 @@
--- include/my_openssl.h.orig 2020-03-23 17:35:17 UTC
+++ include/my_openssl.h
@@ -51,7 +51,7 @@ extern "C" {
*/
static inline int mysql_OPENSSL_init()
{
-#if defined(HAVE_STATIC_OPENSSL)
+#if defined(HAVE_STATIC_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER)
return OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL);
#else
return SSL_library_init();

View File

@ -0,0 +1,12 @@
--- sql/auth/sha2_password_common.cc
+++ sql/auth/sha2_password_common.cc
@@ -116,7 +116,8 @@ bool SHA256_digest::retrieve_digest(unsigned char *digest,
DBUG_RETURN(true);
}
m_ok= EVP_DigestFinal_ex(md_context, m_digest, NULL);
-#if defined(HAVE_WOLFSSL) || OPENSSL_VERSION_NUMBER < 0x10100000L
+#if defined(HAVE_WOLFSSL) || OPENSSL_VERSION_NUMBER < 0x10100000L || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x02090000fL)
EVP_MD_CTX_cleanup(md_context);
#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
EVP_MD_CTX_reset(md_context);

View File

@ -0,0 +1,35 @@
--- vio/viosslfactories.c
+++ vio/viosslfactories.c
@@ -123,21 +123,19 @@ static DH *get_dh2048(void)
DH *dh;
if ((dh=DH_new()))
{
- 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. */
+ 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);
- return NULL;
+ dh = NULL;
}
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
- dh->p= p;
- dh->g= g;
-#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
}
return(dh);
}

View File

@ -3,7 +3,7 @@
PORTNAME?= mysql
PORTVERSION= 5.7.30
PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= MYSQL/MySQL-5.7
PKGNAMESUFFIX?= 57-server

View File

@ -0,0 +1,11 @@
--- include/my_openssl.h.orig 2020-03-23 17:35:17 UTC
+++ include/my_openssl.h
@@ -51,7 +51,7 @@ extern "C" {
*/
static inline int mysql_OPENSSL_init()
{
-#if defined(HAVE_STATIC_OPENSSL)
+#if defined(HAVE_STATIC_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER)
return OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL);
#else
return SSL_library_init();

View File

@ -0,0 +1,11 @@
--- rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c.orig 2020-03-23 17:35:17 UTC
+++ rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c
@@ -529,7 +529,7 @@ int xcom_init_ssl(const char *server_key_file, const c
break e.g. ODBC clients (if the client also uses SSL).
*/
-#if defined(HAVE_STATIC_OPENSSL)
+#if defined(HAVE_STATIC_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER)
OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL);
#else
SSL_library_init();

View File

@ -0,0 +1,12 @@
--- sql/auth/sha2_password_common.cc
+++ sql/auth/sha2_password_common.cc
@@ -116,7 +116,8 @@ bool SHA256_digest::retrieve_digest(unsigned char *digest,
DBUG_RETURN(true);
}
m_ok= EVP_DigestFinal_ex(md_context, m_digest, NULL);
-#if defined(HAVE_WOLFSSL) || OPENSSL_VERSION_NUMBER < 0x10100000L
+#if defined(HAVE_WOLFSSL) || OPENSSL_VERSION_NUMBER < 0x10100000L || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x02090000fL)
EVP_MD_CTX_cleanup(md_context);
#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
EVP_MD_CTX_reset(md_context);

View File

@ -0,0 +1,35 @@
--- vio/viosslfactories.c
+++ vio/viosslfactories.c
@@ -123,21 +123,19 @@ static DH *get_dh2048(void)
DH *dh;
if ((dh=DH_new()))
{
- 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. */
+ 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);
- return NULL;
+ dh = NULL;
}
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
- dh->p= p;
- dh->g= g;
-#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
}
return(dh);
}