[Asterisk-code-review] openssl 1.1 support: use OPENSSL VERSION NUMBER (asterisk[master])

Tzafrir Cohen asteriskteam at digium.com
Sat Jan 21 00:04:01 CST 2017


Tzafrir Cohen has uploaded a new change for review. ( https://gerrit.asterisk.org/4753 )

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.

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


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/53/4753/1

diff --git a/main/iostream.c b/main/iostream.c
index 22cd598..6187bc2 100644
--- a/main/iostream.c
+++ b/main/iostream.c
@@ -465,19 +465,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 !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
 #if 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  /* !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L */
 			}
 
 			SSL_free(stream->ssl);
diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c
index 9905b15..36982e2 100644
--- a/main/libasteriskssl.c
+++ b/main/libasteriskssl.c
@@ -72,7 +72,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)
@@ -114,7 +114,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 */
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e448f55ef516aedf6ad154037c35577a421a458
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Tzafrir Cohen <tzafrir.cohen at xorcom.com>



More information about the asterisk-code-review mailing list