openvpn: update to 2.4.9
[openwrt/openwrt.git] / package / network / services / openvpn / patches / 110-openssl-dont-use-deprecated-ssleay-symbols.patch
1 From 17a476fd5c8cc49f1d103a50199e87ede76b1b67 Mon Sep 17 00:00:00 2001
2 From: Steffan Karger <steffan@karger.me>
3 Date: Sun, 26 Nov 2017 16:04:00 +0100
4 Subject: [PATCH] openssl: don't use deprecated SSLEAY/SSLeay symbols
5
6 Compiling our current master against OpenSSL 1.1 with
7 -DOPENSSL_API_COMPAT=0x10100000L screams bloody murder. This patch fixes
8 the errors about the deprecated SSLEAY/SSLeay symbols and defines.
9
10 Signed-off-by: Steffan Karger <steffan@karger.me>
11 Acked-by: Gert Doering <gert@greenie.muc.de>
12 Message-Id: <20171126150401.28565-1-steffan@karger.me>
13 URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15934.html
14 Signed-off-by: Gert Doering <gert@greenie.muc.de>
15 ---
16 configure.ac | 1 +
17 src/openvpn/openssl_compat.h | 8 ++++++++
18 src/openvpn/ssl_openssl.c | 2 +-
19 3 files changed, 10 insertions(+), 1 deletion(-)
20
21 --- a/configure.ac
22 +++ b/configure.ac
23 @@ -904,6 +904,7 @@ if test "${enable_crypto}" = "yes" -a "$
24 EVP_MD_CTX_free \
25 EVP_MD_CTX_reset \
26 EVP_CIPHER_CTX_reset \
27 + OpenSSL_version \
28 SSL_CTX_get_default_passwd_cb \
29 SSL_CTX_get_default_passwd_cb_userdata \
30 SSL_CTX_set_security_level \
31 --- a/src/openvpn/openssl_compat.h
32 +++ b/src/openvpn/openssl_compat.h
33 @@ -689,6 +689,14 @@ EC_GROUP_order_bits(const EC_GROUP *grou
34 #endif
35
36 /* SSLeay symbols have been renamed in OpenSSL 1.1 */
37 +#ifndef OPENSSL_VERSION
38 +#define OPENSSL_VERSION SSLEAY_VERSION
39 +#endif
40 +
41 +#ifndef HAVE_OPENSSL_VERSION
42 +#define OpenSSL_version SSLeay_version
43 +#endif
44 +
45 #if !defined(RSA_F_RSA_OSSL_PRIVATE_ENCRYPT)
46 #define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT RSA_F_RSA_EAY_PRIVATE_ENCRYPT
47 #endif
48 --- a/src/openvpn/ssl_openssl.c
49 +++ b/src/openvpn/ssl_openssl.c
50 @@ -2008,7 +2008,7 @@ get_highest_preference_tls_cipher(char *
51 const char *
52 get_ssl_library_version(void)
53 {
54 - return SSLeay_version(SSLEAY_VERSION);
55 + return OpenSSL_version(OPENSSL_VERSION);
56 }
57
58 #endif /* defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) */