<mbedtls/net.h> is deprecated as of mbedTLS 2.4.0, it is renamed
<mbedtls/net_sockets.h>. OpenVPN will fail to build with
mbedTLS 2.4.0 with MBEDTLS_DEPRECATED_REMOVED defined.
Check MBEDTLS_VERSION_NUMBER, and include net.h for < 2.4.0 and
net_sockets.h for >= 2.4.0.
Signed-off-by: Magnus Kroken <mkroken@gmail.com>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1481274455-657-1-git-send-email-mkroken@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13451.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
... | ... |
@@ -51,11 +51,17 @@ |
51 | 51 |
#include "ssl_verify_mbedtls.h" |
52 | 52 |
#include <mbedtls/debug.h> |
53 | 53 |
#include <mbedtls/error.h> |
54 |
-#include <mbedtls/net.h> |
|
54 |
+#include <mbedtls/version.h> |
|
55 |
+ |
|
56 |
+#if MBEDTLS_VERSION_NUMBER >= 0x02040000 |
|
57 |
+ #include <mbedtls/net_sockets.h> |
|
58 |
+#else |
|
59 |
+ #include <mbedtls/net.h> |
|
60 |
+#endif |
|
61 |
+ |
|
55 | 62 |
#include <mbedtls/oid.h> |
56 | 63 |
#include <mbedtls/pem.h> |
57 | 64 |
#include <mbedtls/sha256.h> |
58 |
-#include <mbedtls/version.h> |
|
59 | 65 |
|
60 | 66 |
void |
61 | 67 |
tls_init_lib() |