[Asterisk-code-review] BuildSystem: Add patches to allow building with recent LibreSSL (asterisk[13])

Joshua Colp asteriskteam at digium.com
Wed Jun 14 14:22:59 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5784 )

Change subject: BuildSystem: Add patches to allow building with recent LibreSSL
......................................................................

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
---
M main/libasteriskssl.c
M main/tcptls.c
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c
index 9dea3df..dcb3f88 100644
--- a/main/libasteriskssl.c
+++ b/main/libasteriskssl.c
@@ -74,7 +74,7 @@
 	}
 }
 
-#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 @@
 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 7e09e66..bc2d64b 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -447,13 +447,13 @@
 					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

-- 
To view, visit https://gerrit.asterisk.org/5784
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I2f6c08a5840b85ad4d2b75370b947ddde7a9a572
Gerrit-Change-Number: 5784
Gerrit-PatchSet: 1
Gerrit-Owner: Guido Falsi <madpilot at freebsd.org>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170614/18279df6/attachment.html>


More information about the asterisk-code-review mailing list