From 0a4fa9b1fb0819fc65ccaba18dd2608024c8472e Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 18 Dec 2018 23:45:29 +0000 Subject: [PATCH] Add parameter validation test for mbedtls_ecp_check_budget() --- tests/suites/test_suite_ecp.function | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/suites/test_suite_ecp.function b/tests/suites/test_suite_ecp.function index 40a037ec0c..de61022b12 100644 --- a/tests/suites/test_suite_ecp.function +++ b/tests/suites/test_suite_ecp.function @@ -43,6 +43,7 @@ void ecp_invalid_param( ) unsigned char buf[42] = { 0 }; const unsigned char *null_buf = NULL; mbedtls_ecp_group_id valid_group = MBEDTLS_ECP_DP_SECP192R1; + mbedtls_ecp_restart_ctx restart_ctx; TEST_INVALID_PARAM( mbedtls_ecp_point_init( NULL ) ); TEST_INVALID_PARAM( mbedtls_ecp_keypair_init( NULL ) ); @@ -50,6 +51,7 @@ void ecp_invalid_param( ) #if defined(MBEDTLS_ECP_RESTARTABLE) TEST_INVALID_PARAM( mbedtls_ecp_restart_init( NULL ) ); + TEST_INVALID_PARAM( mbedtls_ecp_check_budget( NULL, &restart_ctx, 42 ) ); #endif /* MBEDTLS_ECP_RESTARTABLE */ TEST_INVALID_PARAM_RET( MBEDTLS_ERR_ECP_BAD_INPUT_DATA,