From: Willy Tarreau Date: Thu, 5 Nov 2020 14:03:45 +0000 (+0100) Subject: MINOR: ssl: define SSL_CTX_set1_curves_list to itself on BoringSSL X-Git-Tag: v2.3.0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b8af1e30c0c2a485b893f43ea5e2644198dffcc;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/openssl-compat.h b/include/haproxy/openssl-compat.h index d9affa227e..949d897333 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 */