Re: [Openvpn-devel] [PATCH] mbedtls: include correct net/net_sockets header according to version

2016-12-09 Thread Steffan Karger
Hi,

On 9 December 2016 at 10:07, Magnus Kroken  wrote:
>  is deprecated as of mbedTLS 2.4.0, it is renamed
> . 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 
> ---
> Tested, builing with both mbedTLS 2.3.0 and 2.4.0 with
> MBEDTLS_DEPRECATED_REMOVED is successful.
>
> This patch is as much to document the issue as a suggested patch.
> I don't know if MBEDTLS_DEPRECATED_REMOVED is considered a
> distro/package maintainers problem or something to fix with
> an #if, so I won't be sad if it isn't accepted.
>
>  src/openvpn/ssl_mbedtls.c | 10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c
> index 11ee65b..985a39f 100644
> --- a/src/openvpn/ssl_mbedtls.c
> +++ b/src/openvpn/ssl_mbedtls.c
> @@ -51,11 +51,17 @@
>  #include "ssl_verify_mbedtls.h"
>  #include 
>  #include 
> -#include 
> +#include 
> +
> +#if MBEDTLS_VERSION_NUMBER >= 0x0204
> +#include 
> +#else
> +#include 
> +#endif
> +
>  #include 
>  #include 
>  #include 
> -#include 
>
>  void
>  tls_init_lib()
> --
> 2.1.4

Looks good, passes tests. ACK.

We might remove the indenting of the preprocessor statements, but if
not, this will be fixed soon by The Great Reformatting anyway.

-Steffan

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH] mbedtls: include correct net/net_sockets header according to version

2016-12-09 Thread Magnus Kroken
 is deprecated as of mbedTLS 2.4.0, it is renamed
. 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 
---
Tested, builing with both mbedTLS 2.3.0 and 2.4.0 with 
MBEDTLS_DEPRECATED_REMOVED is successful. 

This patch is as much to document the issue as a suggested patch.
I don't know if MBEDTLS_DEPRECATED_REMOVED is considered a
distro/package maintainers problem or something to fix with 
an #if, so I won't be sad if it isn't accepted.

 src/openvpn/ssl_mbedtls.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c
index 11ee65b..985a39f 100644
--- a/src/openvpn/ssl_mbedtls.c
+++ b/src/openvpn/ssl_mbedtls.c
@@ -51,11 +51,17 @@
 #include "ssl_verify_mbedtls.h"
 #include 
 #include 
-#include 
+#include 
+
+#if MBEDTLS_VERSION_NUMBER >= 0x0204
+#include 
+#else
+#include 
+#endif
+
 #include 
 #include 
 #include 
-#include 
 
 void
 tls_init_lib()
-- 
2.1.4


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel