From b0ad58152671312854a7a80e3c52a80162382b32 Mon Sep 17 00:00:00 2001 From: Ron Eldor Date: Wed, 29 Aug 2018 19:06:14 +0300 Subject: [PATCH] Remove the invalid input for platform module Remove the invalid input for the platform module, as it's not currently used in the Mbed OS platform setup \ termination code. --- include/mbedtls/error.h | 2 +- include/mbedtls/platform.h | 3 +-- library/error.c | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/mbedtls/error.h b/include/mbedtls/error.h index 95415dc72..2b83c2d9b 100644 --- a/include/mbedtls/error.h +++ b/include/mbedtls/error.h @@ -80,7 +80,7 @@ * CHACHA20 3 0x0051-0x0055 * POLY1305 3 0x0057-0x005B * CHACHAPOLY 2 0x0054-0x0056 - * PLATFORM 2 0x0080-0x0082 + * PLATFORM 1 0x0080-0x0080 * * High-level module nr (3 bits - 0x0...-0x7...) * Name ID Nr of Errors diff --git a/include/mbedtls/platform.h b/include/mbedtls/platform.h index a1cd689f3..cb21d2ac0 100644 --- a/include/mbedtls/platform.h +++ b/include/mbedtls/platform.h @@ -43,8 +43,7 @@ #include "platform_time.h" #endif -#define MBEDTLS_ERR_PLATFORM_INVALID_DATA -0x0080 /**< Bad input parameters to the platform function. */ -#define MBEDTLS_ERR_PLATFORM_HW_FAILED -0x0082 /**< Hardware platform function failed. */ +#define MBEDTLS_ERR_PLATFORM_HW_FAILED -0x0080 /**< Hardware platform function failed. */ #ifdef __cplusplus extern "C" { diff --git a/library/error.c b/library/error.c index f34a6effa..d3b155b62 100644 --- a/library/error.c +++ b/library/error.c @@ -826,8 +826,6 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen ) #endif /* MBEDTLS_PADLOCK_C */ #if defined(MBEDTLS_PLATFORM_C) - if( use_ret == -(MBEDTLS_ERR_PLATFORM_INVALID_DATA) ) - mbedtls_snprintf( buf, buflen, "PLATFORM - Bad input parameters to the platform function" ); if( use_ret == -(MBEDTLS_ERR_PLATFORM_HW_FAILED) ) mbedtls_snprintf( buf, buflen, "PLATFORM - Hardware platform function failed" ); #endif /* MBEDTLS_PLATFORM_C */