Test that xxx_free() functions accept NULL parameter

This commit is contained in:
Hanno Becker 2018-12-12 16:44:41 +00:00
parent 236ea16c01
commit a994b2379f
3 changed files with 3 additions and 0 deletions

View file

@ -94,6 +94,7 @@ void chacha20_bad_params()
mbedtls_chacha20_context ctx;
TEST_INVALID_PARAM( mbedtls_chacha20_init( NULL ) );
TEST_VALID_PARAM( mbedtls_chacha20_free( NULL ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA,
mbedtls_chacha20_setkey( NULL, key ) );

View file

@ -139,6 +139,7 @@ void chachapoly_bad_params()
memset( mac, 0x00, sizeof( mac ) );
TEST_INVALID_PARAM( mbedtls_chachapoly_init( NULL ) );
TEST_VALID_PARAM( mbedtls_chachapoly_free( NULL ) );
/* setkey */
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA,

View file

@ -98,6 +98,7 @@ void poly1305_bad_params()
mbedtls_poly1305_context ctx;
TEST_INVALID_PARAM( mbedtls_poly1305_init( NULL ) );
TEST_VALID_PARAM( mbedtls_poly1305_free( NULL ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA,
mbedtls_poly1305_starts( NULL, key ) );