]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
main/iostream.c: fix build with libressl
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 25 Feb 2023 10:27:12 +0000 (11:27 +0100)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 6 Mar 2023 17:25:32 +0000 (11:25 -0600)
Fix the following build failure with libressl by using SSL_is_server
which is available since version 2.7.0 and
https://github.com/libressl-portable/openbsd/commit/d7ec516916c5eaac29b02d7a8ac6570f63b458f7:

iostream.c: In function 'ast_iostream_close':
iostream.c:559:41: error: invalid use of incomplete typedef 'SSL' {aka 'struct ssl_st'}
  559 |                         if (!stream->ssl->server) {
      |                                         ^~

ASTERISK-30107 #close

Fixes: - http://autobuild.buildroot.org/results/ce4d62d00bb77ba5b303cacf6be7e350581a62f9
Change-Id: Iea7f34970297f2fb50285d73462d0174ba7e9587

main/iostream.c

index d060b6d6d445cda68d6ce6968ad4ce8b4b15b9fe..7727983423bcb29d2f465f0232bb2b84b018092d 100644 (file)
@@ -553,7 +553,7 @@ int ast_iostream_close(struct ast_iostream *stream)
                                        ERR_error_string(sslerr, err), ssl_error_to_string(sslerr, res));
                        }
 
-#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+#if !(defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER < 0x2070000L)) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)
                        if (!SSL_is_server(stream->ssl)) {
 #else
                        if (!stream->ssl->server) {