Package: asterisk / 1:13.14.1~dfsg-2+deb9u4

OpenSSL-1.1.0-support.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 0d555f0d81d3b04366a64c91acb89d24b90aead9 Mon Sep 17 00:00:00 2001
From: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Date: Sat, 21 Jan 2017 07:57:33 +0200
Subject: [PATCH] openssl 1.1 support: use OPENSSL_VERSION_NUMBER

Use OPENSSL_VERSION_NUMBER instead of OPENSSL_API_COMPAT to detect
the openssl 1.1 API.

ASTERISK-26109 #close

Change-Id: I4e448f55ef516aedf6ad154037c35577a421a458
---

diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c
index c4d4c56..bf5ecc1 100644
--- a/main/libasteriskssl.c
+++ b/main/libasteriskssl.c
@@ -74,7 +74,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)
@@ -116,7 +116,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 */
 
diff --git a/main/tcptls.c b/main/tcptls.c
index 21abd26..71bd92e 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -400,19 +400,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 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);