From: Arne Schwabe Date: Wed, 16 Feb 2022 13:56:53 +0100 Message-Id: <20220216125653.4080943-1-arne@...1227...> MIME-Version: 1.0 Subject: [Openvpn-devel] [PATCH] Fix mbed TLS compile if OpenSSL headers are not available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: openvpn-devel@lists.sourceforge.net We unconditionally include openssl/opensslv.h which fails if OpenSSL header are not available. Signed-off-by: Arne Schwabe --- src/openvpn/xkey_common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openvpn/xkey_common.h b/src/openvpn/xkey_common.h index e58748b4..67c888be 100644 --- a/src/openvpn/xkey_common.h +++ b/src/openvpn/xkey_common.h @@ -25,11 +25,14 @@ #ifndef XKEY_COMMON_H_ #define XKEY_COMMON_H_ +/* Guard to only enable if OpenSSL is used and not trigger an error if mbed + * TLS is compiled without OpenSSL being installed */ +#if defined(ENABLE_CRYPTO_OPENSSL) #include #if OPENSSL_VERSION_NUMBER >= 0x30000010L && !defined(DISABLE_XKEY_PROVIDER) #define HAVE_XKEY_PROVIDER 1 #include -#include +#include /** * Initialization function for OpenVPN external key provider for OpenSSL @@ -169,4 +172,6 @@ xkey_max_saltlen(int modBits, int hLen) } #endif /* HAVE_XKEY_PROVIDER */ +#endif /* ENABLE_CRYPTO_OPENSSL */ + #endif /* XKEY_COMMON_H_ */ -- 2.33.0