From 5b8af1e30c0c2a485b893f43ea5e2644198dffcc Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 5 Nov 2020 15:03:45 +0100 Subject: [PATCH] MINOR: ssl: define SSL_CTX_set1_curves_list to itself on BoringSSL OpenSSL 1.0.2 and onwards define SSL_CTX_set1_curves_list which is both a function and a macro. OpenSSL 1.0.2 to 1.1.0 define SSL_CTRL_SET_CURVES_LIST as a macro, which disappeared from 1.1.1. BoringSSL only has that one and not the former macro but it does have the function. Let's keep the test on the macro matching the function name by defining the macro to itself when needed. --- include/haproxy/openssl-compat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/haproxy/openssl-compat.h b/include/haproxy/openssl-compat.h index d9affa227..949d89733 100644 --- a/include/haproxy/openssl-compat.h +++ b/include/haproxy/openssl-compat.h @@ -383,5 +383,15 @@ static inline void SSL_CTX_up_ref(SSL_CTX *ctx) #define EVP_MD_CTX_free EVP_MD_CTX_destroy #endif +/* OpenSSL 1.0.2 and onwards define SSL_CTX_set1_curves_list which is both a + * function and a macro. OpenSSL 1.0.2 to 1.1.0 define SSL_CTRL_SET_CURVES_LIST + * as a macro, which disappeared from 1.1.1. BoringSSL only has that one and + * not the former macro but it does have the function. Let's keep the test on + * the macro matching the function name. + */ +#if !defined(SSL_CTX_set1_curves_list) && defined(SSL_CTRL_SET_CURVES_LIST) +#define SSL_CTX_set1_curves_list SSL_CTX_set1_curves_list +#endif + #endif /* USE_OPENSSL */ #endif /* _HAPROXY_OPENSSL_COMPAT_H */