Hello, small cleanup patch.
Ilya
From 637f02dc75a68bf40d30cb78d4e021551d323d90 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin <chipits...@gmail.com> Date: Sat, 23 Apr 2022 23:07:26 +0500 Subject: [PATCH] CLEANUP: move ssl_sock_load_ocsp definition to openssl-compat.h literally it removes one "ifdef" and moves missing function definition to openssl-compat.h --- include/haproxy/openssl-compat.h | 5 +++++ src/ssl_sock.c | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/haproxy/openssl-compat.h b/include/haproxy/openssl-compat.h index 5aaa6c7e9..373b388db 100644 --- a/include/haproxy/openssl-compat.h +++ b/include/haproxy/openssl-compat.h @@ -202,6 +202,11 @@ static inline STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain) * Functions missing in BoringSSL */ +static int ssl_sock_load_ocsp(SSL_CTX *ctx, const struct cert_key_and_chain *ckch, STACK_OF(X509) *chain) +{ + return SSL_CTX_set_ocsp_response(ctx, (const uint8_t *)ckch->ocsp_response->area, ckch->ocsp_response->data); +} + static inline X509_CRL *X509_OBJECT_get0_X509_CRL(const X509_OBJECT *a) { if (a == NULL || a->type != X509_LU_CRL) { diff --git a/src/ssl_sock.c b/src/ssl_sock.c index d823d92d3..6d69f79a1 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -1518,14 +1518,6 @@ static int ssl_sock_load_ocsp(SSL_CTX *ctx, const struct cert_key_and_chain *ckc } #endif -#ifdef OPENSSL_IS_BORINGSSL -static int ssl_sock_load_ocsp(SSL_CTX *ctx, const struct cert_key_and_chain *ckch, STACK_OF(X509) *chain) -{ - return SSL_CTX_set_ocsp_response(ctx, (const uint8_t *)ckch->ocsp_response->area, ckch->ocsp_response->data); -} -#endif - - #ifdef HAVE_SSL_CTX_ADD_SERVER_CUSTOM_EXT #define CT_EXTENSION_TYPE 18 -- 2.35.3.windows.1