kumquat-buildroot/package/syslog-ng/0002-lib-tlscontext.c-fix-libressl-build.patch

86 lines
3.6 KiB
Diff
Raw Normal View History

From 6f93484cea81ff8d45df213d5d2b4cffc4eadcad Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sat, 16 Jul 2022 18:09:25 +0200
Subject: [PATCH] lib/tlscontext.c: fix libressl build
Fix the following build failure with libressl raised since version
3.37.1 and
https://github.com/syslog-ng/syslog-ng/commit/c7ba645918480da06b9e065c62ebd630312b0c7f:
/nvmedata/autobuild/instance-5/output-1/host/lib/gcc/nios2-buildroot-linux-gnu/10.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld: ./lib/.libs/libsyslog-ng.so: undefined reference to `SSL_CTX_set1_client_sigalgs_list'
/nvmedata/autobuild/instance-5/output-1/host/lib/gcc/nios2-buildroot-linux-gnu/10.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld: ./lib/.libs/libsyslog-ng.so: undefined reference to `SSL_CTX_set1_sigalgs_list'
Fixes:
- http://autobuild.buildroot.org/results/84cf9f6a0f6de831a685b73c42eab868952c8b15
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/syslog-ng/syslog-ng/pull/4081]
---
cmake/openssl_functions.cmake | 4 +++-
configure.ac | 2 ++
lib/tlscontext.c | 4 ++++
syslog-ng-config.h.in | 2 ++
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/cmake/openssl_functions.cmake b/cmake/openssl_functions.cmake
index afd7b96bfe..319dcc2e23 100644
--- a/cmake/openssl_functions.cmake
+++ b/cmake/openssl_functions.cmake
@@ -42,7 +42,9 @@ function (openssl_set_defines)
DH_set0_pqg
BN_get_rfc3526_prime_2048
SSL_CTX_set_num_tickets
- SSL_CTX_set_ciphersuites)
+ SSL_CTX_set_ciphersuites
+ SSL_CTX_set1_sigalgs_list
+ SSL_CTX_set1_client_sigalgs_list)
foreach (symbol ${symbol_list})
string(TOUPPER ${symbol} SYMBOL_UPPERCASE)
diff --git a/configure.ac b/configure.ac
index 8cfab2251e..ecffb84f06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1055,6 +1055,8 @@ AC_CHECK_DECLS([ASN1_STRING_get0_data], [], [], [[#include <openssl/asn1.h>]])
AC_CHECK_DECLS([DH_set0_pqg], [], [], [[#include <openssl/dh.h>]])
AC_CHECK_DECLS([BN_get_rfc3526_prime_2048], [], [], [[#include <openssl/bn.h>]])
AC_CHECK_DECLS([SSL_CTX_set_num_tickets],[], [], [[#include <openssl/ssl.h>]])
+AC_CHECK_DECLS([SSL_CTX_set1_sigalgs_list],[], [], [[#include <openssl/ssl.h>]])
+AC_CHECK_DECLS([SSL_CTX_set1_client_sigalgs_list],[], [], [[#include <openssl/ssl.h>]])
CPPFLAGS="$CPPFLAGS_SAVE"
diff --git a/lib/tlscontext.c b/lib/tlscontext.c
index ddde21dcaf..dedcf1ce5a 100644
--- a/lib/tlscontext.c
+++ b/lib/tlscontext.c
@@ -598,11 +598,15 @@ tls_context_setup_cipher_suite(TLSContext *self)
static gboolean
tls_context_setup_sigalgs(TLSContext *self)
{
+#if SYSLOG_NG_HAVE_DECL_SSL_CTX_SET1_SIGALGS_LIST
if (self->sigalgs && !SSL_CTX_set1_sigalgs_list(self->ssl_ctx, self->sigalgs))
return FALSE;
+#endif
+#if SYSLOG_NG_HAVE_DECL_SSL_CTX_SET1_CLIENT_SIGALGS_LIST
if (self->client_sigalgs && !SSL_CTX_set1_client_sigalgs_list(self->ssl_ctx, self->client_sigalgs))
return FALSE;
+#endif
return TRUE;
}
diff --git a/syslog-ng-config.h.in b/syslog-ng-config.h.in
index 1817deea50..004b0a7be6 100644
--- a/syslog-ng-config.h.in
+++ b/syslog-ng-config.h.in
@@ -57,6 +57,8 @@
#cmakedefine01 SYSLOG_NG_HAVE_DECL_ASN1_STRING_GET0_DATA
#cmakedefine01 SYSLOG_NG_HAVE_DECL_SSL_CTX_GET0_PARAM
#cmakedefine01 SYSLOG_NG_HAVE_DECL_SSL_CTX_SET_CIPHERSUITES
+#cmakedefine01 SYSLOG_NG_HAVE_DECL_SSL_CTX_SET1_SIGALGS_LIST
+#cmakedefine01 SYSLOG_NG_HAVE_DECL_SSL_CTX_SET1_CLIENT_SIGALGS_LIST
#cmakedefine01 SYSLOG_NG_HAVE_DECL_X509_STORE_CTX_GET0_CERT
#cmakedefine01 SYSLOG_NG_HAVE_DECL_X509_GET_EXTENSION_FLAGS
#cmakedefine01 SYSLOG_NG_HAVE_DECL_DH_SET0_PQG