]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix mbed TLS compile if OpenSSL headers are not available
authorArne Schwabe <arne@rfc2549.org>
Wed, 16 Feb 2022 12:56:53 +0000 (13:56 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 16 Feb 2022 13:07:31 +0000 (14:07 +0100)
We unconditionally include openssl/opensslv.h which fails if OpenSSL header
are not available.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220216125653.4080943-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23804.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/xkey_common.h

index e58748b4229eba58c53134b3b67fc7e55077aea2..16242b00324947c16c81240affd7d3f8216204f6 100644 (file)
@@ -25,6 +25,9 @@
 #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
@@ -169,4 +172,6 @@ xkey_max_saltlen(int modBits, int hLen)
 }
 #endif /* HAVE_XKEY_PROVIDER */
 
+#endif /* ENABLE_CRYPTO_OPENSSL */
+
 #endif /* XKEY_COMMON_H_ */