diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2016-06-28 23:26:59 +0200 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2016-12-01 01:22:45 +0000 |
commit | 26c8552fff499419bdf12b663e76ecfc408b3085 (patch) | |
tree | 69353feb47b0a11a4d8b3673b8beca40c9b07622 /main/iostream.c | |
parent | fdf4355bd054ce3a264f3d7a83725259b8acb32f (diff) |
OpenSSL 1.1.0 support
OpenSSL 1.1.0 includes some major changes in the interface. See
https://wiki.openssl.org/index.php/1.1_API_Changes .
Status: Right now there are still a few deprecation notes with OpenSSL
1.1.0. But it's a start.
Changes:
* CRYPTO_LOCK is no longer available. Replace it with its value for now.
I don't completely understand what it is used for there.
* Remove several functions from libasteriskssl that seem to no longer be
needed.
* Structures have become opaque and are accesses with accessors.
* ERR_remove_thread_state() no longer needed.
* SSLv2 code now could no longer be used in 1.1.
ASTERISK-26109 #close
Change-Id: I5e29d477d486ca29b6aae0dc2f5dff960c1cb82b
Diffstat (limited to 'main/iostream.c')
-rw-r--r-- | main/iostream.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/iostream.c b/main/iostream.c index 008888142..a20a04896 100644 --- a/main/iostream.c +++ b/main/iostream.c @@ -462,9 +462,19 @@ int ast_iostream_close(struct ast_iostream *stream) SSL_get_error(stream->ssl, res)); } +#if defined(OPENSSL_API_COMPAT) && OPENSSL_API_COMPAT >= 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 + ERR_remove_thread_state(NULL); +#else ERR_remove_state(0); +#endif /* OPENSSL_VERSION_NUMBER >= 0x10000000L */ +#endif /* !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < 0x10100000L */ } SSL_free(stream->ssl); |