0
0
mirror of https://github.com/openwrt/packages.git synced 2025-01-31 03:41:44 +00:00
packages/net/pen/patches/010-deprecated-openssl.patch
Ilya Lipnitskiy 5d8d4fbbcb treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00

45 lines
1.2 KiB
Diff

From 652dd89d297df2dbf7fc7a235d5305b5fc945e2f Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sun, 25 Nov 2018 19:09:33 -0800
Subject: [PATCH] Fix compilation under OpenSSL 1.1 without deprecated APIs
---
ssl.c | 4 ++++
ssl.h | 2 ++
2 files changed, 6 insertions(+)
--- a/ssl.c
+++ b/ssl.c
@@ -359,7 +359,9 @@ static SSL_CTX *ssl_create_context(char
debug("continuing anyway...");
}
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_CTX_set_tmp_rsa_callback(ssl_context, ssl_temp_rsa_cb);
+#endif
SSL_CTX_set_info_callback(ssl_context, ssl_info_cb);
SSL_CTX_set_tlsext_status_cb(ssl_context, ssl_stapling_cb);
SSL_CTX_set_tlsext_servername_callback(ssl_context, ssl_sni_cb);
@@ -405,8 +407,10 @@ static SSL_CTX *ssl_create_context(char
int ssl_init(void)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_load_error_strings();
SSLeay_add_ssl_algorithms();
+#endif
ssl_context = ssl_create_context(keyfile, certfile, cacert_dir, cacert_file);
if (ssl_context == NULL) {
error("Unable to create default context");
--- a/ssl.h
+++ b/ssl.h
@@ -1,6 +1,8 @@
#ifdef HAVE_LIBSSL
#include <openssl/ssl.h>
#include <openssl/err.h>
+#include <openssl/bn.h>
+#include <openssl/rsa.h>
#define SRV_SSL_V23 0
#define SRV_SSL_V2 1