Files
angie/0002-Disable-ENGINE-support.patch
T

101 lines
3.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Uhliarik?= <luhliari@redhat.com>
Date: Tue, 2 Jul 2024 18:29:18 +0200
Subject: [PATCH 2/3] Disable ENGINE support
---
auto/options | 3 +++
configure | 4 ++++
src/event/ngx_event_openssl.c | 4 ++--
src/event/ngx_event_openssl.h | 2 +-
src/event/ngx_event_openssl_cache.c | 2 +-
5 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/auto/options b/auto/options
index 3d05925..7d3ad00 100644
--- a/auto/options
+++ b/auto/options
@@ -48,6 +48,8 @@ USE_THREADS=NO
NGX_FILE_AIO=NO
+NGX_SSL_NO_ENGINE=NO
+
QUIC_BPF=NO
HTTP=YES
@@ -428,6 +430,7 @@ use the \"--with-mail_ssl_module\" option instead"
--with-openssl=*) OPENSSL="$value" ;;
--with-openssl-opt=*) OPENSSL_OPT="$value" ;;
+ --without-engine) NGX_SSL_NO_ENGINE=YES ;;
--with-md5=*)
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
diff --git a/configure b/configure
index f16be92..ad557ae 100755
--- a/configure
+++ b/configure
@@ -95,6 +95,10 @@ have=NGX_HTTP_SCGI_TEMP_PATH value="\"$NGX_HTTP_SCGI_TEMP_PATH\""
have=NGX_HTTP_ACME_CLIENT_PATH value="\"$NGX_HTTP_ACME_CLIENT_PATH\""
. auto/define
+if [ $NGX_SSL_NO_ENGINE = YES ]; then
+ have=NGX_SSL_NO_ENGINE . auto/have
+fi
+
. auto/make
. auto/lib/make
. auto/install
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 9279aa2..442b692 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -7483,7 +7483,7 @@ ngx_openssl_init_conf(ngx_cycle_t *cycle, void *conf)
static char *
ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
-#ifndef OPENSSL_NO_ENGINE
+#if !defined(OPENSSL_NO_ENGINE) && !defined(NGX_SSL_NO_ENGINE)
ngx_openssl_conf_t *oscf = conf;
@@ -7534,7 +7534,7 @@ ngx_openssl_exit(ngx_cycle_t *cycle)
#if OPENSSL_VERSION_NUMBER < 0x10100003L
EVP_cleanup();
-#ifndef OPENSSL_NO_ENGINE
+#if !defined(OPENSSL_NO_ENGINE) && !defined(NGX_SSL_NO_ENGINE)
ENGINE_cleanup();
#endif
diff --git a/src/event/ngx_event_openssl.h b/src/event/ngx_event_openssl.h
index 4f48e9c..f1810c9 100644
--- a/src/event/ngx_event_openssl.h
+++ b/src/event/ngx_event_openssl.h
@@ -23,7 +23,7 @@
#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
#endif
-#ifndef OPENSSL_NO_ENGINE
+#if !defined(OPENSSL_NO_ENGINE) && !defined(NGX_SSL_NO_ENGINE)
#include <openssl/engine.h>
#endif
#include <openssl/evp.h>
diff --git a/src/event/ngx_event_openssl_cache.c b/src/event/ngx_event_openssl_cache.c
index 04f67ca..9e954a0 100644
--- a/src/event/ngx_event_openssl_cache.c
+++ b/src/event/ngx_event_openssl_cache.c
@@ -712,7 +712,7 @@ ngx_ssl_cache_pkey_create(ngx_ssl_cache_key_t *id, char **err, void *data)
if (id->type == NGX_SSL_CACHE_ENGINE) {
-#ifndef OPENSSL_NO_ENGINE
+#if !defined(OPENSSL_NO_ENGINE) && !defined(NGX_SSL_NO_ENGINE)
u_char *p, *last;
ENGINE *engine;
--
2.56.0