summaryrefslogtreecommitdiff
blob: 63eda0746b9323d016fa7c0d2ed59c6254f8cdb6 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
https://bugs.gentoo.org/662826
https://bugs.gentoo.org/668832
https://bugs.gentoo.org/668894

--- a/sql/auth/sha2_password_common.cc
+++ b/sql/auth/sha2_password_common.cc
@@ -146,7 +146,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);
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3408,7 +3408,8 @@ static int init_ssl()
 {
 #ifdef HAVE_OPENSSL
 #ifndef HAVE_YASSL
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
+    (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2090000fL)
   CRYPTO_malloc_init();
 #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
   OPENSSL_malloc_init();
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -121,21 +121,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);
 }