From f9c1387b9d0114195f3f80eb514495924b36c1c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 11 Mar 2015 10:59:38 +0000 Subject: [PATCH] Drop POLARSSL_ERROR_STRERROR_BC --- ChangeLog | 1 + include/mbedtls/config.h | 14 -------------- include/mbedtls/error.h | 4 ---- library/error.c | 13 ------------- library/version_features.c | 3 --- scripts/data_files/error.fmt | 13 ------------- tests/suites/test_suite_error.function | 8 -------- 7 files changed, 1 insertion(+), 55 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe1ce5c4b..2aad56964 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Features * Support for DTLS 1.0 and 1.2 (RFC 6347). API Changes + * Remove POLARSSL_ERROR_STRERROR_BC (use mbedtls_strerror()). * Headers are now found in the 'mbedtls' directory (previously 'polarssl'). * Change SSL_DISABLE_RENEGOTIATION config.h flag to SSL_RENEGOTIATION (support for renegotiation now needs explicit enabling in config.h). diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h index dbb12181c..79387521c 100644 --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h @@ -644,20 +644,6 @@ */ #define POLARSSL_PK_PARSE_EC_EXTENDED -/** - * \def POLARSSL_ERROR_STRERROR_BC - * - * 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. - * - * Disable if you run into name conflicts and want to really remove the - * error_strerror() - */ -#define POLARSSL_ERROR_STRERROR_BC - /** * \def POLARSSL_ERROR_STRERROR_DUMMY * diff --git a/include/mbedtls/error.h b/include/mbedtls/error.h index 56b499793..c6cd948ee 100644 --- a/include/mbedtls/error.h +++ b/include/mbedtls/error.h @@ -109,10 +109,6 @@ extern "C" { */ void polarssl_strerror( int errnum, char *buffer, size_t buflen ); -#if defined(POLARSSL_ERROR_STRERROR_BC) -void error_strerror( int errnum, char *buffer, size_t buflen ); -#endif - #ifdef __cplusplus } #endif diff --git a/library/error.c b/library/error.c index 38be87935..cc23352fa 100644 --- a/library/error.c +++ b/library/error.c @@ -747,13 +747,6 @@ void polarssl_strerror( int ret, char *buf, size_t buflen ) polarssl_snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", use_ret ); } -#if defined(POLARSSL_ERROR_STRERROR_BC) -void error_strerror( int ret, char *buf, size_t buflen ) -{ - polarssl_strerror( ret, buf, buflen ); -} -#endif /* POLARSSL_ERROR_STRERROR_BC */ - #else /* POLARSSL_ERROR_C */ #if defined(POLARSSL_ERROR_STRERROR_DUMMY) @@ -769,12 +762,6 @@ void polarssl_strerror( int ret, char *buf, size_t buflen ) buf[0] = '\0'; } -#if defined(POLARSSL_ERROR_STRERROR_BC) -void error_strerror( int ret, char *buf, size_t buflen ) -{ - polarssl_strerror( ret, buf, buflen ); -} -#endif /* POLARSSL_ERROR_STRERROR_BC */ #endif /* POLARSSL_ERROR_STRERROR_DUMMY */ #endif /* POLARSSL_ERROR_C */ diff --git a/library/version_features.c b/library/version_features.c index 4fe6e46ff..c9f2efb49 100644 --- a/library/version_features.c +++ b/library/version_features.c @@ -237,9 +237,6 @@ static const char *features[] = { #if defined(POLARSSL_PK_PARSE_EC_EXTENDED) "POLARSSL_PK_PARSE_EC_EXTENDED", #endif /* POLARSSL_PK_PARSE_EC_EXTENDED */ -#if defined(POLARSSL_ERROR_STRERROR_BC) - "POLARSSL_ERROR_STRERROR_BC", -#endif /* POLARSSL_ERROR_STRERROR_BC */ #if defined(POLARSSL_ERROR_STRERROR_DUMMY) "POLARSSL_ERROR_STRERROR_DUMMY", #endif /* POLARSSL_ERROR_STRERROR_DUMMY */ diff --git a/scripts/data_files/error.fmt b/scripts/data_files/error.fmt index 98799a155..ba675e4b9 100644 --- a/scripts/data_files/error.fmt +++ b/scripts/data_files/error.fmt @@ -109,13 +109,6 @@ LOW_LEVEL_CODE_CHECKS polarssl_snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", use_ret ); } -#if defined(POLARSSL_ERROR_STRERROR_BC) -void error_strerror( int ret, char *buf, size_t buflen ) -{ - polarssl_strerror( ret, buf, buflen ); -} -#endif /* POLARSSL_ERROR_STRERROR_BC */ - #else /* POLARSSL_ERROR_C */ #if defined(POLARSSL_ERROR_STRERROR_DUMMY) @@ -131,12 +124,6 @@ void polarssl_strerror( int ret, char *buf, size_t buflen ) buf[0] = '\0'; } -#if defined(POLARSSL_ERROR_STRERROR_BC) -void error_strerror( int ret, char *buf, size_t buflen ) -{ - polarssl_strerror( ret, buf, buflen ); -} -#endif /* POLARSSL_ERROR_STRERROR_BC */ #endif /* POLARSSL_ERROR_STRERROR_DUMMY */ #endif /* POLARSSL_ERROR_C */ diff --git a/tests/suites/test_suite_error.function b/tests/suites/test_suite_error.function index 8ed3b61ef..6873059d4 100644 --- a/tests/suites/test_suite_error.function +++ b/tests/suites/test_suite_error.function @@ -17,13 +17,5 @@ void error_strerror( int code, char *result_str ) polarssl_strerror( code, buf, 500 ); TEST_ASSERT( strcmp( buf, result_str ) == 0 ); - -#if defined(POLARSSL_ERROR_STRERROR_BC) - memset( buf, 0, sizeof( buf ) ); - - error_strerror( code, buf, 500 ); - - TEST_ASSERT( strcmp( buf, result_str ) == 0 ); -#endif } /* END_CASE */