diff --git a/include/mbedtls/aes.h b/include/mbedtls/aes.h index 35c222918..62c1f9234 100644 --- a/include/mbedtls/aes.h +++ b/include/mbedtls/aes.h @@ -69,16 +69,12 @@ #if defined( MBEDTLS_CHECK_PARAMS ) #define MBEDTLS_AES_VALIDATE_RET( cond ) do{ if( !(cond) ) { \ - MBEDTLS_PARAM_FAILED( #cond, \ - __FILE__, \ - __LINE__ ); \ + MBEDTLS_PARAM_FAILED( #cond ); \ return MBEDTLS_ERR_AES_BAD_INPUT_DATA;} \ } while(0); #define MBEDTLS_AES_VALIDATE( cond ) do{ if( !(cond) ) { \ - MBEDTLS_PARAM_FAILED( #cond, \ - __FILE__, \ - __LINE__ ); \ + MBEDTLS_PARAM_FAILED( #cond ); \ return; } \ } while(0); #else diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h index a8a8f7568..25f6c8c28 100644 --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h @@ -3015,7 +3015,7 @@ //#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ //#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ -//#define MBEDTLS_PARAM_FAILED(x) mbedtls_param_failed( #x ) /**< Default parameter validation callback to use. Can be undefined */ +//#define MBEDTLS_PARAM_FAILED(x) mbedtls_param_failed( #x, __FILE__, __LINE__ ) /**< Default parameter validation callback to use. Can be undefined */ /* SSL Cache options */ diff --git a/include/mbedtls/platform_util.h b/include/mbedtls/platform_util.h index d09957152..6aada21c9 100644 --- a/include/mbedtls/platform_util.h +++ b/include/mbedtls/platform_util.h @@ -42,8 +42,8 @@ extern "C" { #endif #if defined( MBEDTLS_CHECK_PARAMS ) && !defined(MBEDTLS_PARAM_FAILED) -#define MBEDTLS_PARAM_FAILED( cond, file, line ) \ - mbedtls_param_failed( cond, file, line ) +#define MBEDTLS_PARAM_FAILED( cond ) \ + mbedtls_param_failed( cond, __FILE__, __LINE__ ) /** * \brief User supplied callback function for parameter validation failure. @@ -65,7 +65,6 @@ extern "C" { * execution in the application code. */ void mbedtls_param_failed( char* failure_condition, char* file, int line ); - #endif /* MBEDTLS_CHECK_PARAMS && !MBEDTLS_PARAM_FAILED */ /** diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function index 3ae547184..4b9513f9d 100644 --- a/tests/suites/helpers.function +++ b/tests/suites/helpers.function @@ -25,7 +25,7 @@ #if defined(MBEDTLS_CHECK_PARAMS) #include -#define MBEDTLS_PARAM_FAILED(x) mbedtls_param_failed( #x ) +#define MBEDTLS_PARAM_FAILED(x) mbedtls_param_failed( #x, __FILE__, __LINE__ ) #endif /* MBEDTLS_CHECK_PARAMS */