From: Guido Falsi Date: Thu, 8 Jun 2017 15:54:46 +0000 (+0200) Subject: BuildSystem: Add patches to allow building with recent LibreSSL X-Git-Tag: 14.6.0-rc1~40^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1366359f12b0b0e69ca62fc1d06af99c836d49e;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c index df45919226..292c98eafe 100644 --- a/main/libasteriskssl.c +++ b/main/libasteriskssl.c @@ -74,7 +74,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) @@ -129,7 +129,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)); diff --git a/main/tcptls.c b/main/tcptls.c index 1f99d7b923..8e50a0c8e9 100644 --- a/main/tcptls.c +++ b/main/tcptls.c @@ -446,13 +446,13 @@ static int tcptls_stream_close(void *cookie) 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 !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER >= 0x10000000L ERR_remove_thread_state(NULL); #else