Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2.3
-
None
-
FreeBSD build.brnrd.eu 11.0-RELEASE-p3 FreeBSD 11.0-RELEASE-p3 #0 r308890: Sun Nov 20 20:27:48 CET 2016 build@build.brnrd.eu:/usr/obj/usr/src/sys/BEASTIE110 amd64
Description
If LibreSSL is used as provider of SSL libraries, building libmariadb fails. This is due to LibreSSL defining OPENSSL_VERSION_NUMBER to 0x20000000L.
The patch is simple:
--- libmariadb/libmariadb/secure/openssl.c.orig 2016-12-22 11:09:46.000000000 +0100
|
+++ libmariadb/libmariadb/secure/openssl.c 2017-01-15 11:22:15.049274000 +0100
|
@@ -53,7 +53,7 @@
|
#define MAX_SSL_ERR_LEN 100
|
|
static pthread_mutex_t LOCK_openssl_config;
|
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
static pthread_mutex_t *LOCK_crypto= NULL;
|
#endif
|
#if OPENSSL_USE_BIOMETHOD
|
@@ -86,7 +86,7 @@
|
}
|
|
|
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
/*
|
thread safe callbacks for OpenSSL
|
Crypto call back functions will be
|
@@ -209,7 +209,7 @@
|
}
|
#endif
|
|
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
static void my_cb_locking(int mode, int n,
|
const char *file __attribute__((unused)),
|
int line __attribute__((unused)))
|
@@ -287,7 +287,7 @@
|
/* lock mutex to prevent multiple initialization */
|
pthread_mutex_init(&LOCK_openssl_config,MY_MUTEX_INIT_FAST);
|
pthread_mutex_lock(&LOCK_openssl_config);
|
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
if (!OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL))
|
goto end;
|
#else
|