]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
libasteriskssl: do nothing with OpenSSL >= 1.1 50/4950/3
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Fri, 3 Feb 2017 08:25:33 +0000 (10:25 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 14 Feb 2017 21:30:03 +0000 (23:30 +0200)
OpenSSL 1.1 requires no explicit initialization. The hacks in the
library are not needed. They also happen to fail running Asterisk.

ASTERISK-26109 #close

Change-Id: I3b3efd5d80234a4c45a8ee58dcfe25b15d9ad100

main/libasteriskssl.c
main/tcptls.c

index bf5ecc1b30bc3db20b7ab19ff73447e4be17a8cb..9dea3df0b305603d83a2f16238cb436f704a239b 100644 (file)
@@ -123,10 +123,13 @@ void ERR_free_strings(void)
 /*!
  * \internal
  * \brief Common OpenSSL initialization for all of Asterisk.
+ *
+ * Not needed for OpenSSL versions >= 1.1.0
  */
 int ast_ssl_init(void)
 {
-#ifdef HAVE_OPENSSL
+#if defined(HAVE_OPENSSL) && defined(OPENSSL_VERSION_NUMBER) && \
+       OPENSSL_VERSION_NUMBER < 0x10100000L
        unsigned int i;
        int (*real_SSL_library_init)(void);
        void (*real_CRYPTO_set_id_callback)(unsigned long (*)(void));
@@ -191,7 +194,7 @@ int ast_ssl_init(void)
 
        startup_complete = 1;
 
-#endif /* HAVE_OPENSSL */
+#endif /* HAVE_OPENSSL and its version < 1.1 */
        return 0;
 }
 
index 36a6c965901667599b9e01fe18aa9b3d401c6e1c..4d110cda94b277f38a6bf796c3cc5dfa243f35fb 100644 (file)
@@ -412,7 +412,7 @@ static int tcptls_stream_close(void *cookie)
 #else
                                ERR_remove_state(0);
 #endif /* openssl == 1.0 */
-#endif  /* openssl >= 1.1 */
+#endif  /* openssl < 1.1 */
                        }
 
                        SSL_free(stream->ssl);