mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-24 17:41:01 +03:00
Test that xxx_free() functions accept NULL parameter
This commit is contained in:
@@ -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 ) );
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 ) );
|
||||
|
||||
Reference in New Issue
Block a user