From 220cdece404c53be0017aaf6597622662b6bd696 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 11 Jan 2021 12:27:21 +0000 Subject: [PATCH] Fix error code combination check `mbedtls_test_err_add_check` was previously incorrectly throwing an error if both error codes were correct and valid pure error codes. This change fixes that behaviour to correctly throw errors when invalid combinations are found. Signed-off-by: Chris Jones --- tests/src/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/helpers.c b/tests/src/helpers.c index 2c01a584a..d88ef43f0 100644 --- a/tests/src/helpers.c +++ b/tests/src/helpers.c @@ -287,7 +287,7 @@ void mbedtls_param_failed( const char *failure_condition, void mbedtls_test_err_add_check( int high, int low, const char *file, int line ) { - if ( high < -0x0FFF && low > -0x007F ) + if ( high > -0x1000 || low < -0x007F ) { mbedtls_fprintf( stderr, "\nIncorrect error code addition at %s:%d\n", file, line );