mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 08:16:33 +01:00
Add 'exit' label and variable initialization to relevant test suite functions
This commit is contained in:
parent
318d0fe844
commit
bd51b262d1
31 changed files with 235 additions and 28 deletions
|
|
@ -39,10 +39,12 @@ void pbkdf2_hmac( int hash, char *hex_password_string,
|
|||
TEST_ASSERT( md_init_ctx( &ctx, info ) == 0 );
|
||||
TEST_ASSERT( pkcs5_pbkdf2_hmac( &ctx, pw_str, pw_len, salt_str, salt_len,
|
||||
it_cnt, key_len, key ) == 0 );
|
||||
md_free( &ctx );
|
||||
|
||||
hexify( dst_str, key, key_len );
|
||||
TEST_ASSERT( strcmp( (char *) dst_str, result_key_string ) == 0 );
|
||||
|
||||
exit:
|
||||
md_free( &ctx );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
|
@ -52,7 +54,7 @@ void pkcs5_pbes2( int params_tag, char *params_hex, char *pw_hex,
|
|||
{
|
||||
int my_ret;
|
||||
asn1_buf params;
|
||||
unsigned char *my_out, *ref_out, *data, *pw;
|
||||
unsigned char *my_out = NULL, *ref_out = NULL, *data = NULL, *pw = NULL;
|
||||
size_t ref_out_len, data_len, pw_len;
|
||||
|
||||
params.tag = params_tag;
|
||||
|
|
@ -70,6 +72,7 @@ void pkcs5_pbes2( int params_tag, char *params_hex, char *pw_hex,
|
|||
if( ref_ret == 0 )
|
||||
TEST_ASSERT( memcmp( my_out, ref_out, ref_out_len ) == 0 );
|
||||
|
||||
exit:
|
||||
polarssl_free( params.p );
|
||||
polarssl_free( data );
|
||||
polarssl_free( pw );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue