From 47e0214d2c4365b3ea236ee72405bc7336a37c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 18 Mar 2015 16:52:20 +0000 Subject: [PATCH 1/3] Add -fdata-sections in memory.sh too --- scripts/memory.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/memory.sh b/scripts/memory.sh index eefe1025d..4b02a722a 100755 --- a/scripts/memory.sh +++ b/scripts/memory.sh @@ -12,7 +12,7 @@ CONFIG_H='include/polarssl/config.h' CLIENT='mini_client' -CFLAGS_EXEC='-fno-asynchronous-unwind-tables -Wl,--gc-section -ffunction-sections' +CFLAGS_EXEC='-fno-asynchronous-unwind-tables -Wl,--gc-section -ffunction-sections -fdata-sections' CFLAGS_MEM=-g3 if [ -r $CONFIG_H ]; then :; else From 71432849ed87558d3b4e2e9adcd2bfa8f6609de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 20 Mar 2015 16:19:35 +0000 Subject: [PATCH 2/3] Use proper doxygen markup to mark deprecations --- include/polarssl/cipher.h | 2 +- include/polarssl/config.h | 7 +++++-- include/polarssl/md.h | 2 +- include/polarssl/memory.h | 9 ++++++++- include/polarssl/pbkdf2.h | 9 ++++++--- include/polarssl/platform.h | 2 +- include/polarssl/ssl.h | 6 ++---- include/polarssl/x509.h | 9 ++++++--- library/cipher.c | 2 +- library/pbkdf2.c | 3 +-- 10 files changed, 32 insertions(+), 19 deletions(-) diff --git a/include/polarssl/cipher.h b/include/polarssl/cipher.h index 977cc97d7..6773f61c6 100644 --- a/include/polarssl/cipher.h +++ b/include/polarssl/cipher.h @@ -376,7 +376,7 @@ int cipher_init_ctx( cipher_context_t *ctx, const cipher_info_t *cipher_info ); * \brief Free the cipher-specific context of ctx. Freeing ctx * itself remains the responsibility of the caller. * - * \note Deprecated: Redirects to cipher_free() + * \deprecated Use cipher_free() instead * * \param ctx Free the cipher-specific context * diff --git a/include/polarssl/config.h b/include/polarssl/config.h index 7f93140c8..a811f8b60 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -1695,7 +1695,9 @@ /** * \def POLARSSL_MEMORY_C - * Deprecated since 1.3.5. Please use POLARSSL_PLATFORM_MEMORY instead. + * + * \deprecated Use POLARSSL_PLATFORM_MEMORY instead. + * * Depends on: POLARSSL_PLATFORM_C */ //#define POLARSSL_MEMORY_C @@ -1768,7 +1770,8 @@ * \def POLARSSL_PBKDF2_C * * Enable PKCS#5 PBKDF2 key derivation function. - * DEPRECATED: Use POLARSSL_PKCS5_C instead + * + * \deprecated Use POLARSSL_PKCS5_C instead * * Module: library/pbkdf2.c * diff --git a/include/polarssl/md.h b/include/polarssl/md.h index 3472f80b4..95da80be8 100644 --- a/include/polarssl/md.h +++ b/include/polarssl/md.h @@ -204,7 +204,7 @@ int md_init_ctx( md_context_t *ctx, const md_info_t *md_info ); * \brief Free the message-specific context of ctx. Freeing ctx itself * remains the responsibility of the caller. * - * \note Deprecated: Redirects to md_free() + * \deprecated Use md_free() instead * * \param ctx Free the message-specific context * diff --git a/include/polarssl/memory.h b/include/polarssl/memory.h index 9b2daef37..8312beb95 100644 --- a/include/polarssl/memory.h +++ b/include/polarssl/memory.h @@ -1,7 +1,9 @@ /** * \file memory.h * - * \brief Memory allocation layer (Deprecated to platform layer) + * \brief Memory allocation layer + * + * \deprecated Use the platform layer instead * * Copyright (C) 2006-2014, ARM Limited, All Rights Reserved * @@ -35,6 +37,11 @@ #include "platform.h" #include "memory_buffer_alloc.h" +/** + * \brief Set malloc() / free() callback + * + * \deprecated Use platform_set_malloc_free instead + */ int memory_set_own( void * (*malloc_func)( size_t ), void (*free_func)( void * ) ) { diff --git a/include/polarssl/pbkdf2.h b/include/polarssl/pbkdf2.h index 5c06bfb0d..e842c838a 100644 --- a/include/polarssl/pbkdf2.h +++ b/include/polarssl/pbkdf2.h @@ -2,7 +2,8 @@ * \file pbkdf2.h * * \brief Password-Based Key Derivation Function 2 (from PKCS#5) - * DEPRECATED: use pkcs5.h instead. + * + * \deprecated Use pkcs5.h instead. * * \author Mathias Olsson * @@ -46,7 +47,8 @@ extern "C" { /** * \brief PKCS#5 PBKDF2 using HMAC - * DEPRECATED: Use pkcs5_pbkdf2_hmac() instead! + * + * \deprecated Use pkcs5_pbkdf2_hmac() instead * * \param ctx Generic HMAC context * \param password Password to use when generating key @@ -66,7 +68,8 @@ int pbkdf2_hmac( md_context_t *ctx, const unsigned char *password, /** * \brief Checkup routine - * DEPRECATED: Use pkcs5_self_test() instead! + * + * \deprecated Use pkcs5_self_test() instead * * \return 0 if successful, or 1 if the test failed */ diff --git a/include/polarssl/platform.h b/include/polarssl/platform.h index 76e61bbf9..32d1c9f25 100644 --- a/include/polarssl/platform.h +++ b/include/polarssl/platform.h @@ -30,7 +30,7 @@ #include POLARSSL_CONFIG_FILE #endif -/* Temporary compability hack for to keep the deprecated MEMORY_C working */ +/* Temporary compability hack for to keep MEMORY_C working */ #if defined(POLARSSL_MEMORY_C) && !defined(POLARSSL_PLATFORM_MEMORY) #define POLARSSL_PLATFORM_MEMORY #endif diff --git a/include/polarssl/ssl.h b/include/polarssl/ssl.h index 921680e0f..8e8213797 100644 --- a/include/polarssl/ssl.h +++ b/include/polarssl/ssl.h @@ -1221,8 +1221,7 @@ int ssl_set_own_cert( ssl_context *ssl, x509_crt *own_cert, * up your certificate chain. The top certificate (self-signed) * can be omitted. * - * \warning This backwards-compatibility function is deprecated! - * Please use \c ssl_set_own_cert() instead. + * \deprecated Please use \c ssl_set_own_cert() instead. * * \param ssl SSL context * \param own_cert own public certificate chain @@ -1246,8 +1245,7 @@ int ssl_set_own_cert_rsa( ssl_context *ssl, x509_crt *own_cert, * up your certificate chain. The top certificate (self-signed) * can be omitted. * - * \warning This backwards-compatibility function is deprecated! - * Please use \c pk_init_ctx_rsa_alt() + * \deprecated Please use \c pk_init_ctx_rsa_alt() * and \c ssl_set_own_cert() instead. * * \param ssl SSL context diff --git a/include/polarssl/x509.h b/include/polarssl/x509.h index 268121d95..9dda082a5 100644 --- a/include/polarssl/x509.h +++ b/include/polarssl/x509.h @@ -227,8 +227,10 @@ int x509_serial_gets( char *buf, size_t size, const x509_buf *serial ); /** * \brief Give an known OID, return its descriptive string. - * (Deprecated. Use oid_get_extended_key_usage() instead.) - * Warning: only works for extended_key_usage OIDs! + * + * \deprecated Use oid_get_extended_key_usage() instead. + * + * \warning Only works for extended_key_usage OIDs! * * \param oid buffer containing the oid * @@ -239,7 +241,8 @@ const char *x509_oid_get_description( x509_buf *oid ); /** * \brief Give an OID, return a string version of its OID number. - * (Deprecated. Use oid_get_numeric_string() instead) + * + * \deprecated Use oid_get_numeric_string() instead. * * \param buf Buffer to write to * \param size Maximum size of buffer diff --git a/library/cipher.c b/library/cipher.c index 8c7452b1f..516fa0084 100644 --- a/library/cipher.c +++ b/library/cipher.c @@ -165,7 +165,7 @@ int cipher_init_ctx( cipher_context_t *ctx, const cipher_info_t *cipher_info ) return( 0 ); } -/* Deprecated, redirects to cipher_free() */ +/* compatibility wrapper */ int cipher_free_ctx( cipher_context_t *ctx ) { cipher_free( ctx ); diff --git a/library/pbkdf2.c b/library/pbkdf2.c index 54494ab4e..b4ef19500 100644 --- a/library/pbkdf2.c +++ b/library/pbkdf2.c @@ -1,8 +1,7 @@ /** * \file pbkdf2.c * - * \brief Password-Based Key Derivation Function 2 (from PKCS#5) - * DEPRECATED: Use pkcs5.c instead + * \brief Compatibility wrappers for pkcs5.c * * \author Mathias Olsson * From e658176dfad4e30b6b2fdefbc0d465f30cb308e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 20 Mar 2015 17:21:21 +0000 Subject: [PATCH 3/3] Mark a few additional deprecations --- include/polarssl/compat-1.2.h | 2 ++ include/polarssl/config.h | 6 ++---- include/polarssl/openssl.h | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/polarssl/compat-1.2.h b/include/polarssl/compat-1.2.h index f7f3d0019..ca9a8e068 100644 --- a/include/polarssl/compat-1.2.h +++ b/include/polarssl/compat-1.2.h @@ -3,6 +3,8 @@ * * \brief Backwards compatibility header for PolarSSL-1.2 from PolarSSL-1.3 * + * \deprecated Use native PolarSSL 1.3 functions instead. + * * Copyright (C) 2006-2013, ARM Limited, All Rights Reserved * * This file is part of mbed TLS (https://tls.mbed.org) diff --git a/include/polarssl/config.h b/include/polarssl/config.h index a811f8b60..be7da2850 100644 --- a/include/polarssl/config.h +++ b/include/polarssl/config.h @@ -650,11 +650,9 @@ * Make available the backward compatible error_strerror() next to the * current polarssl_strerror(). * - * For new code, it is recommended to use polarssl_strerror() instead and - * disable this. + * \deprecated Do not define this and use polarssl_strerror() instead * - * Disable if you run into name conflicts and want to really remove the - * error_strerror() + * Disable if you want to really remove the error_strerror() name */ #define POLARSSL_ERROR_STRERROR_BC diff --git a/include/polarssl/openssl.h b/include/polarssl/openssl.h index 63c16e5cc..dc0eba4d2 100644 --- a/include/polarssl/openssl.h +++ b/include/polarssl/openssl.h @@ -3,6 +3,8 @@ * * \brief OpenSSL wrapper (definitions, inline functions). * + * \deprecated Use native mbed TLS functions instead + * * Copyright (C) 2006-2010, ARM Limited, All Rights Reserved * * This file is part of mbed TLS (https://tls.mbed.org)