From 08f88f7a5997b572e5ffb24a1bb5bf7f81c6bf5b Mon Sep 17 00:00:00 2001 From: Vivek Saini Date: Wed, 20 Apr 2022 01:21:11 +0000 Subject: [PATCH] Fix KeyDB not building with TLS < 1.1.1 --- src/tls.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tls.cpp b/src/tls.cpp index c2490bd56..9b3a0415c 100644 --- a/src/tls.cpp +++ b/src/tls.cpp @@ -491,6 +491,12 @@ bool tlsCheckAgainstAllowlist(const char * client){ return false; } +/* ASN1_STRING_get0_data was introduced in OPENSSL 1.1.1 + * use ASN1_STRING_data for older versions where it is not available */ +#if OPENSSL_VERSION_NUMBER < 0x10100000L +#define ASN1_STRING_get0_data ASN1_STRING_data +#endif + bool tlsValidateCertificateName(tls_connection* conn){ if (g_pserver->tls_allowlist.empty()) return true; // Empty list implies acceptance of all