Add 'exit' label and variable initialization to relevant test suite functions

This commit is contained in:
Paul Bakker 2014-07-10 15:26:12 +02:00
parent 318d0fe844
commit bd51b262d1
31 changed files with 235 additions and 28 deletions

View file

@ -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 );