From a98af5e2b2b68c94b84244f4421ddc6d50bc6746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 9 Apr 2015 14:40:46 +0200 Subject: [PATCH] Deprecate using NET_C without HAVE_IPV6 --- ChangeLog | 1 + configs/config-ccm-psk-tls1_2.h | 2 +- configs/config-psk-rc4-tls1_0.h | 2 +- include/polarssl/check_config.h | 9 +++++++++ include/polarssl/config.h | 6 ++++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c28c51c7..f56b20479 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,7 @@ Bugfix curve picked by the server was actually allowed. Changes + * Enabling POLARSSL_NET_C without POLARSSL_HAVE_IPV6 is deprecated. * compat-1.2.h and openssl.h are deprecated. * Adjusting/overriding CFLAGS and LDFLAGS with the make build syste is now more flexible (warning: OFLAGS is not used any more) (see the README) diff --git a/configs/config-ccm-psk-tls1_2.h b/configs/config-ccm-psk-tls1_2.h index 776179d17..4a3ebb100 100644 --- a/configs/config-ccm-psk-tls1_2.h +++ b/configs/config-ccm-psk-tls1_2.h @@ -12,7 +12,7 @@ #define POLARSSL_CONFIG_H /* System support */ -//#define POLARSSL_HAVE_IPV6 /* Optional */ +#define POLARSSL_HAVE_IPV6 /* Now mandatory for NET_C */ //#define POLARSSL_HAVE_TIME /* Optionally used in Hello messages */ /* Other POLARSSL_HAVE_XXX flags irrelevant for this configuration */ diff --git a/configs/config-psk-rc4-tls1_0.h b/configs/config-psk-rc4-tls1_0.h index b8113ea82..2f557c1c4 100644 --- a/configs/config-psk-rc4-tls1_0.h +++ b/configs/config-psk-rc4-tls1_0.h @@ -12,7 +12,7 @@ #define POLARSSL_CONFIG_H /* System support */ -//#define POLARSSL_HAVE_IPV6 /* Optional */ +#define POLARSSL_HAVE_IPV6 /* Now mandatory for NET_C */ //#define POLARSSL_HAVE_TIME /* Optionnaly used in Hello messages */ /* Other POLARSSL_HAVE_XXX flags irrelevant for this configuration */ diff --git a/include/polarssl/check_config.h b/include/polarssl/check_config.h index a255874ee..f0d83c8d9 100644 --- a/include/polarssl/check_config.h +++ b/include/polarssl/check_config.h @@ -35,6 +35,15 @@ #error "POLARSSL_DEPRECATED_WARNING only works with GCC and Clang" #endif +#if defined(POLARSSL_NET_C) && !defined(POLARSSL_HAVE_IPV6) +#if defined(POLARSSL_DEPRECATED_WARNING) +#warning "Using POLARSSL_NET_C without POLARSSL_HAVE_IPV6 is deprecated" +#endif +#if defined(POLARSSL_DEPRECATED_REMOVED) +#define POLARSSL_HAVE_IPV6 +#endif +#endif /* POLARSSL_NET_C && !POLARSSL_HAVE_IPV6 */ + #if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM) #error "POLARSSL_AESNI_C defined, but not all prerequisites" #endif diff --git a/include/polarssl/config.h b/include/polarssl/config.h index 220f74dcc..76972dd02 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -107,6 +107,9 @@ * * Note: on Windows/MingW, XP or higher is required. * + * \warning As of 1.3.11, *not* using this flag when POLARSSL_NET_C is + * defined, is deprecated. The alternative legacy code will be removed in 2.0. + * * Comment if your system does not support the IPv6 socket interface */ #define POLARSSL_HAVE_IPV6 @@ -1757,6 +1760,9 @@ * * Enable the TCP/IP networking routines. * + * \warning As of 1.3.11, it is deprecated to enable this module without + * POLARSSL_HAVE_IPV6. The alternative legacy code will be removed in 2.0. + * * Module: library/net.c * * This module provides TCP/IP networking routines.