openvpn: update to 2.4.8
[openwrt/openwrt.git] / package / network / services / openvpn / patches / 111-openssl-add-missing-include-statements.patch
1 From 1987498271abadf042d8bb3feee1fe0d877a9d55 Mon Sep 17 00:00:00 2001
2 From: Steffan Karger <steffan@karger.me>
3 Date: Sun, 26 Nov 2017 16:49:12 +0100
4 Subject: [PATCH] openssl: add missing #include statements
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 caused by missing includes. Previous openssl versions would
9 usually include 'the rest of the world', but they're fixing that. So we
10 should no longer rely on it.
11
12 (And sneaking in alphabetic ordering of the includes while touching them.)
13
14 Signed-off-by: Steffan Karger <steffan@karger.me>
15 Acked-by: Gert Doering <gert@greenie.muc.de>
16 Message-Id: <20171126154912.13283-1-steffan@karger.me>
17 URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15936.html
18 Signed-off-by: Gert Doering <gert@greenie.muc.de>
19 ---
20 src/openvpn/openssl_compat.h | 1 +
21 src/openvpn/ssl_openssl.c | 6 +++++-
22 src/openvpn/ssl_verify_openssl.c | 3 ++-
23 3 files changed, 8 insertions(+), 2 deletions(-)
24
25 --- a/src/openvpn/openssl_compat.h
26 +++ b/src/openvpn/openssl_compat.h
27 @@ -42,6 +42,7 @@
28
29 #include "buffer.h"
30
31 +#include <openssl/rsa.h>
32 #include <openssl/ssl.h>
33 #include <openssl/x509.h>
34
35 --- a/src/openvpn/ssl_openssl.c
36 +++ b/src/openvpn/ssl_openssl.c
37 @@ -52,10 +52,14 @@
38
39 #include "ssl_verify_openssl.h"
40
41 +#include <openssl/bn.h>
42 +#include <openssl/crypto.h>
43 +#include <openssl/dh.h>
44 +#include <openssl/dsa.h>
45 #include <openssl/err.h>
46 #include <openssl/pkcs12.h>
47 +#include <openssl/rsa.h>
48 #include <openssl/x509.h>
49 -#include <openssl/crypto.h>
50 #ifndef OPENSSL_NO_EC
51 #include <openssl/ec.h>
52 #endif
53 --- a/src/openvpn/ssl_verify_openssl.c
54 +++ b/src/openvpn/ssl_verify_openssl.c
55 @@ -44,8 +44,9 @@
56 #include "ssl_verify_backend.h"
57 #include "openssl_compat.h"
58
59 -#include <openssl/x509v3.h>
60 +#include <openssl/bn.h>
61 #include <openssl/err.h>
62 +#include <openssl/x509v3.h>
63
64 int
65 verify_callback(int preverify_ok, X509_STORE_CTX *ctx)