[asterisk-commits] openssl 1.1 support: use OPENSSL VERSION NUMBER (asterisk[14])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 15 08:43:52 CST 2017


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4951 )

Change subject: openssl 1.1 support: use OPENSSL_VERSION_NUMBER
......................................................................


openssl 1.1 support: use OPENSSL_VERSION_NUMBER

Use OPENSSL_VERSION_NUMBER instead of OPENSSL_API_COMPAT to detect
the openssl 1.1 API.

ASTERISK-26109 #close

Change-Id: I4e448f55ef516aedf6ad154037c35577a421a458
---
M main/libasteriskssl.c
M main/tcptls.c
2 files changed, 7 insertions(+), 7 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c
index 4e6ea1a..33fcf4f 100644
--- a/main/libasteriskssl.c
+++ b/main/libasteriskssl.c
@@ -74,7 +74,7 @@
 	}
 }
 
-#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L
+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
 int SSL_library_init(void)
 {
 #if defined(AST_DEVMODE)
@@ -116,7 +116,7 @@
 {
 	/* we can't allow this to be called, ever */
 }
-#endif /* !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L */
+#endif /* !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L */
 
 #endif /* HAVE_OPENSSL */
 
diff --git a/main/tcptls.c b/main/tcptls.c
index 513676c..c49379c 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -399,19 +399,19 @@
 					SSL_get_error(stream->ssl, res));
 			}
 
-#if defined(OPENSSL_API_COMPAT) && OPENSSL_API_COMPAT >= 0x10100000L
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
 			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_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER >= 0x10000000L
 				ERR_remove_thread_state(NULL);
 #else
 				ERR_remove_state(0);
-#endif	/* OPENSSL_VERSION_NUMBER >= 0x10000000L */
-#endif  /* !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L */
+#endif	/* openssl = 1.0 */
+#endif  /* openssl < 1.1 */
 			}
 
 			SSL_free(stream->ssl);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4e448f55ef516aedf6ad154037c35577a421a458
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list