1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4358,7 +4358,11 @@ 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 /* 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));
+#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);
|