1 From 5e0e401dc69b9c25e5f85de7484a70ea97862e16 Mon Sep 17 00:00:00 2001
2 From: Rosen Penev <rosenp@gmail.com>
3 Date: Wed, 12 Dec 2018 13:45:59 -0800
4 Subject: [PATCH 2/2] Fix compilation without deprecated OpenSSL APIs
6 This is an optional part of OpenWrt designed to save space.
8 src/connection.c | 4 ++--
9 src/connection.h | 4 ++++
12 4 files changed, 12 insertions(+), 2 deletions(-)
14 diff --git a/src/connection.c b/src/connection.c
15 index 38b3ccfe..d137af12 100644
16 --- a/src/connection.c
17 +++ b/src/connection.c
18 @@ -96,13 +96,13 @@ void free_connection_partially(connection_t *c) {
22 - EVP_CIPHER_CTX_cleanup(c->inctx);
23 + EVP_CIPHER_CTX_reset(c->inctx);
29 - EVP_CIPHER_CTX_cleanup(c->outctx);
30 + EVP_CIPHER_CTX_reset(c->outctx);
34 diff --git a/src/connection.h b/src/connection.h
35 index 629e16b9..4f554672 100644
36 --- a/src/connection.h
37 +++ b/src/connection.h
39 #include <openssl/rsa.h>
40 #include <openssl/evp.h>
42 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
43 +#define EVP_CIPHER_CTX_reset(c) EVP_CIPHER_CTX_cleanup(c)
48 #define OPTION_INDIRECT 0x0001
49 diff --git a/src/net_setup.c b/src/net_setup.c
50 index cac7455d..f26007bd 100644
54 #include <openssl/rand.h>
55 #include <openssl/err.h>
56 #include <openssl/evp.h>
57 +#include <openssl/bn.h>
61 diff --git a/src/tincd.c b/src/tincd.c
62 index bdac0c9d..e8a60449 100644
66 #ifndef OPENSSL_NO_ENGINE
67 #include <openssl/engine.h>
69 +#include <openssl/bn.h>
73 @@ -692,7 +693,9 @@ int main(int argc, char **argv) {
74 ENGINE_register_all_complete();
77 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
78 OpenSSL_add_all_algorithms();
83 @@ -811,10 +814,12 @@ end:
87 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
90 #ifndef OPENSSL_NO_ENGINE
95 exit_configuration(&config_tree);