]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
openssl 1.1 support: use OPENSSL_VERSION_NUMBER 48/4948/2
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Sat, 21 Jan 2017 05:57:33 +0000 (07:57 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 14 Feb 2017 20:45:28 +0000 (22:45 +0200)
Use OPENSSL_VERSION_NUMBER instead of OPENSSL_API_COMPAT to detect
the openssl 1.1 API.

ASTERISK-26109 #close

Change-Id: I4e448f55ef516aedf6ad154037c35577a421a458

main/libasteriskssl.c
main/tcptls.c

index c4d4c56f4abaf007499443291908b539507402c2..bf5ecc1b30bc3db20b7ab19ff73447e4be17a8cb 100644 (file)
@@ -74,7 +74,7 @@ static void ssl_lock(int mode, int n, const char *file, int line)
        }
 }
 
-#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 @@ void ERR_free_strings(void)
 {
        /* 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 */
 
index 21abd26b6031364c34e76df4b6fd7c851d8fbfd3..71bd92eb697b36b4e4d9fc6a33d6bc7d3457b5c8 100644 (file)
@@ -400,19 +400,19 @@ static int tcptls_stream_close(void *cookie)
                                        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);