summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Falsi <madpilot@freebsd.org>2017-06-08 17:54:46 +0200
committerGuido Falsi <madpilot@freebsd.org>2017-06-09 15:34:34 +0200
commitd27168d36ffb634e4a70a3c93738bfa9da7e2605 (patch)
tree26fd8456ae28b0d3edb0a727729ddefe406eec25
parentdb5245f9fde620afdd9b2c7c327bd1b77d8d4718 (diff)
BuildSystem: Add patches to allow building with recent LibreSSL
Add some #if defined checks which allow building against LibreSSL. These patchess come from OpenBSD ports: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/telephony/asterisk/patches/ ASTERISK-27043 #close Reported by: OpenBSD ports Change-Id: I2f6c08a5840b85ad4d2b75370b947ddde7a9a572
-rw-r--r--main/iostream.c4
-rw-r--r--main/libasteriskssl.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/main/iostream.c b/main/iostream.c
index 06414cf43..2a2601d38 100644
--- a/main/iostream.c
+++ b/main/iostream.c
@@ -508,13 +508,13 @@ int ast_iostream_close(struct ast_iostream *stream)
ERR_error_string(sslerr, err), ssl_error_to_string(sslerr, res));
}
-#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
if (!SSL_is_server(stream->ssl)) {
#else
if (!stream->ssl->server) {
#endif
/* For client threads, ensure that the error stack is cleared */
-#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
ERR_remove_thread_state(NULL);
#else
diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c
index 0ed05e3dc..9da63de4c 100644
--- a/main/libasteriskssl.c
+++ b/main/libasteriskssl.c
@@ -72,7 +72,7 @@ static void ssl_lock(int mode, int n, const char *file, int line)
}
}
-#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
int SSL_library_init(void)
{
#if defined(AST_DEVMODE)
@@ -127,7 +127,7 @@ void ERR_free_strings(void)
int ast_ssl_init(void)
{
#if defined(HAVE_OPENSSL) && defined(OPENSSL_VERSION_NUMBER) && \
- OPENSSL_VERSION_NUMBER < 0x10100000L
+ (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
unsigned int i;
int (*real_SSL_library_init)(void);
void (*real_CRYPTO_set_id_callback)(unsigned long (*)(void));