We unconditionally include openssl/opensslv.h which fails if OpenSSL header
are not available.

Signed-off-by: Arne Schwabe <a...@rfc2549.org>
---
 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 <openssl/opensslv.h>
 #if OPENSSL_VERSION_NUMBER >= 0x30000010L && !defined(DISABLE_XKEY_PROVIDER)
 #define HAVE_XKEY_PROVIDER 1
 #include <openssl/provider.h>
-#include <openssl/core_dispatch.h>
+#include <openssl/core_dispatnch.h>
 
 /**
  * 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



_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to