From 8c3f0f4c16993b4eaa2d26aebf672ac52b12778e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 9 Apr 2015 14:10:26 +0200 Subject: [PATCH] Official deprecate compat-1.2.h and openssl.h --- ChangeLog | 5 +++-- include/polarssl/compat-1.2.h | 10 ++++++++++ include/polarssl/openssl.h | 9 +++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3341cefde..8c28c51c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,9 +19,9 @@ Features speed and RAM (heap only for now) usage. * New script memory.sh helps measuring the ROM and RAM requirements of two reduced configurations (PSK-CCM and NSA suite B). - * Add config flags POLARSSL_DEPRECATED_WARNING (off by default) to produce + * Add config flag POLARSSL_DEPRECATED_WARNING (off by default) to produce warnings on use of deprecated functions (with GCC and Clang only). - * Add config flags POLARSSL_DEPRECATED_REMOVED (off by default) to produce + * Add config flag POLARSSL_DEPRECATED_REMOVED (off by default) to produce errors on use of deprecated functions. Bugfix @@ -43,6 +43,7 @@ Bugfix curve picked by the server was actually allowed. Changes + * 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) (contributed by Alon Bar-Lev). diff --git a/include/polarssl/compat-1.2.h b/include/polarssl/compat-1.2.h index ca9a8e068..441ced7c5 100644 --- a/include/polarssl/compat-1.2.h +++ b/include/polarssl/compat-1.2.h @@ -23,6 +23,15 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#if ! defined(MBEDTLS_DEPRECATED_REMOVED) + +#if defined(MBEDTLS_DEPRECATED_WARNING) +#warning "Including compat-1.2.h is deprecated" +#endif + +#ifndef MBEDTLS_COMPAT13_H +#define MBEDTLS_COMPAT13_H + #ifndef POLARSSL_COMPAT_1_2_H #define POLARSSL_COMPAT_1_2_H @@ -386,3 +395,4 @@ static inline int x509_write_key_der( unsigned char *buf, size_t len, rsa_contex } #endif /* POLARSSL_PK_WRITE_C && POLARSSL_RSA_C */ #endif /* compat-1.2.h */ +#endif /* MBEDTLS_DEPRECATED_REMOVED */ diff --git a/include/polarssl/openssl.h b/include/polarssl/openssl.h index dc0eba4d2..96435a3e5 100644 --- a/include/polarssl/openssl.h +++ b/include/polarssl/openssl.h @@ -23,9 +23,17 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + /* * OpenSSL wrapper contributed by David Barett */ + +#if ! defined(MBEDTLS_DEPRECATED_REMOVED) + +#if defined(MBEDTLS_DEPRECATED_WARNING) +#warning "Including openssl.h is deprecated" +#endif + #ifndef POLARSSL_OPENSSL_H #define POLARSSL_OPENSSL_H @@ -137,3 +145,4 @@ inline int RSA_private_encrypt( int size, unsigned char* input, unsigned char* o #endif #endif /* openssl.h */ +#endif /* MBEDTLS_DEPRECATED_REMOVED */