mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-29 23:04:28 +01:00
Don't fail until everything is initialized
Can't call mbedtls_cipher_free(&invalid_ctx) in cleanup if mbedtls_cipher_init(&invalid_ctx) hasn't been called. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
3d28378734
commit
3fc0d30447
@ -102,9 +102,10 @@ void cipher_invalid_param_unconditional( )
|
||||
(void)valid_mode; /* In some configurations this is unused */
|
||||
|
||||
mbedtls_cipher_init( &valid_ctx );
|
||||
TEST_ASSERT( mbedtls_cipher_setup( &valid_ctx, valid_info ) == 0 );
|
||||
mbedtls_cipher_init( &invalid_ctx );
|
||||
|
||||
TEST_ASSERT( mbedtls_cipher_setup( &valid_ctx, valid_info ) == 0 );
|
||||
|
||||
/* mbedtls_cipher_setup() */
|
||||
TEST_ASSERT( mbedtls_cipher_setup( &valid_ctx, NULL ) ==
|
||||
MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
|
||||
|
Loading…
Reference in New Issue
Block a user