Add separate test for xxx_free() functions in ECP module

This commit is contained in:
Hanno Becker 2018-12-18 12:50:02 +00:00
parent 5edcfa529f
commit 57b684f9d1
2 changed files with 19 additions and 5 deletions

View File

@ -1,3 +1,6 @@
ECP valid params
ecp_valid_param:
ECP invalid params
ecp_invalid_param:

View File

@ -13,6 +13,22 @@
* END_DEPENDENCIES
*/
/* BEGIN_CASE */
void ecp_valid_param( )
{
TEST_VALID_PARAM( mbedtls_ecp_point_free( NULL ) );
TEST_VALID_PARAM( mbedtls_ecp_keypair_free( NULL ) );
TEST_VALID_PARAM( mbedtls_ecp_point_free( NULL ) );
#if defined(MBEDTLS_ECP_RESTARTABLE)
TEST_VALID_PARAM( mbedtls_ecp_restart_free( NULL ) );
#endif /* MBEDTLS_ECP_RESTARTABLE */
exit:
return;
}
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CHECK_PARAMS:!MBEDTLS_PARAM_FAILED_ALT */
void ecp_invalid_param( )
{
@ -32,13 +48,8 @@ void ecp_invalid_param( )
TEST_INVALID_PARAM( mbedtls_ecp_keypair_init( NULL ) );
TEST_INVALID_PARAM( mbedtls_ecp_point_init( NULL ) );
TEST_VALID_PARAM( mbedtls_ecp_point_free( NULL ) );
TEST_VALID_PARAM( mbedtls_ecp_keypair_free( NULL ) );
TEST_VALID_PARAM( mbedtls_ecp_point_free( NULL ) );
#if defined(MBEDTLS_ECP_RESTARTABLE)
TEST_INVALID_PARAM( mbedtls_ecp_restart_init( NULL ) );
TEST_VALID_PARAM( mbedtls_ecp_restart_free( NULL ) );
#endif /* MBEDTLS_ECP_RESTARTABLE */
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_ECP_BAD_INPUT_DATA,