Commit bd51b262 authored by Paul Bakker's avatar Paul Bakker
Browse files

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

parent 318d0fe8
......@@ -36,6 +36,7 @@ void aes_encrypt_ecb( char *hex_key_string, char *hex_src_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
aes_free( &ctx );
}
/* END_CASE */
......@@ -69,6 +70,7 @@ void aes_decrypt_ecb( char *hex_key_string, char *hex_src_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
aes_free( &ctx );
}
/* END_CASE */
......@@ -106,6 +108,7 @@ void aes_encrypt_cbc( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
aes_free( &ctx );
}
/* END_CASE */
......@@ -143,6 +146,7 @@ void aes_decrypt_cbc( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
aes_free( &ctx );
}
/* END_CASE */
......@@ -177,6 +181,7 @@ void aes_encrypt_cfb128( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
aes_free( &ctx );
}
/* END_CASE */
......@@ -211,6 +216,7 @@ void aes_decrypt_cfb128( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
aes_free( &ctx );
}
/* END_CASE */
......@@ -244,6 +250,7 @@ void aes_encrypt_cfb8( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
aes_free( &ctx );
}
/* END_CASE */
......@@ -277,6 +284,7 @@ void aes_decrypt_cfb8( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
aes_free( &ctx );
}
/* END_CASE */
......
......@@ -33,6 +33,7 @@ void arc4_crypt( char *hex_src_string, char *hex_key_string,
TEST_ASSERT( strcmp( (char *) dst_hexstr, hex_dst_string ) == 0 );
exit:
arc4_free( &ctx );
}
/* END_CASE */
......
......@@ -52,7 +52,7 @@ void base64_decode( char *src_string, char *dst_string, int result )
void base64_encode_hex( char *src_hex, char *dst, int dst_buf_size,
int result )
{
unsigned char *src, *res;
unsigned char *src = NULL, *res = NULL;
size_t len = dst_buf_size, src_len;
src = unhexify_alloc( src_hex, &src_len );
......@@ -65,6 +65,7 @@ void base64_encode_hex( char *src_hex, char *dst, int dst_buf_size,
TEST_ASSERT( memcmp( dst, res, len ) == 0 );
}
exit:
polarssl_free( src );
polarssl_free( res );
}
......@@ -74,7 +75,7 @@ void base64_encode_hex( char *src_hex, char *dst, int dst_buf_size,
void base64_decode_hex( char *src, char *dst_hex, int dst_buf_size,
int result )
{
unsigned char *dst, *res;
unsigned char *dst = NULL, *res = NULL;
size_t len = dst_buf_size, dst_len;
dst = unhexify_alloc( dst_hex, &dst_len );
......@@ -88,6 +89,7 @@ void base64_decode_hex( char *src, char *dst_hex, int dst_buf_size,
TEST_ASSERT( memcmp( dst, res, len ) == 0 );
}
exit:
polarssl_free( dst );
polarssl_free( res );
}
......
......@@ -36,6 +36,7 @@ void blowfish_encrypt_ecb( char *hex_key_string, char *hex_src_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
blowfish_free( &ctx );
}
/* END_CASE */
......@@ -69,6 +70,7 @@ void blowfish_decrypt_ecb( char *hex_key_string, char *hex_src_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
blowfish_free( &ctx );
}
/* END_CASE */
......@@ -107,6 +109,7 @@ void blowfish_encrypt_cbc( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
blowfish_free( &ctx );
}
/* END_CASE */
......@@ -144,6 +147,7 @@ void blowfish_decrypt_cbc( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
blowfish_free( &ctx );
}
/* END_CASE */
......@@ -178,6 +182,7 @@ void blowfish_encrypt_cfb64( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
blowfish_free( &ctx );
}
/* END_CASE */
......@@ -212,6 +217,7 @@ void blowfish_decrypt_cfb64( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
blowfish_free( &ctx );
}
/* END_CASE */
......@@ -248,6 +254,7 @@ void blowfish_encrypt_ctr( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
blowfish_free( &ctx );
}
/* END_CASE */
......@@ -36,6 +36,7 @@ void camellia_encrypt_ecb( char *hex_key_string, char *hex_src_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
camellia_free( &ctx );
}
/* END_CASE */
......@@ -69,6 +70,7 @@ void camellia_decrypt_ecb( char *hex_key_string, char *hex_src_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
camellia_free( &ctx );
}
/* END_CASE */
......@@ -106,6 +108,7 @@ void camellia_encrypt_cbc( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
camellia_free( &ctx );
}
/* END_CASE */
......@@ -143,6 +146,7 @@ void camellia_decrypt_cbc( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
camellia_free( &ctx );
}
/* END_CASE */
......@@ -177,6 +181,7 @@ void camellia_encrypt_cfb128( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
camellia_free( &ctx );
}
/* END_CASE */
......@@ -211,6 +216,7 @@ void camellia_decrypt_cfb128( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
camellia_free( &ctx );
}
/* END_CASE */
......
......@@ -27,6 +27,7 @@ void ccm_init( int cipher_id, int key_size, int result )
ret = ccm_init( &ctx, cipher_id, key, key_size );
TEST_ASSERT( ret == result );
exit:
ccm_free( &ctx );
}
/* END_CASE */
......@@ -64,6 +65,7 @@ void ccm_lengths( int msg_len, int iv_len, int add_len, int tag_len, int res )
else
TEST_ASSERT( decrypt_ret == res );
exit:
ccm_free( &ctx );
}
/* END_CASE */
......@@ -106,6 +108,7 @@ void ccm_encrypt_and_tag( int cipher_id,
/* Check we didn't write past the end */
TEST_ASSERT( msg[result_len] == 0 && msg[result_len + 1] == 0 );
exit:
ccm_free( &ctx );
}
/* END_CASE */
......@@ -171,6 +174,7 @@ void ccm_auth_decrypt( int cipher_id,
/* Check we didn't write past the end (where the original tag is) */
TEST_ASSERT( memcmp( msg + msg_len, tag, tag_len ) == 0 );
exit:
ccm_free( &ctx );
}
/* END_CASE */
......@@ -207,6 +207,7 @@ void enc_dec_buf( int cipher_id, char *cipher_string, int key_len,
/*
* Done
*/
exit:
cipher_free( &ctx_dec );
cipher_free( &ctx_enc );
}
......@@ -259,6 +260,7 @@ void enc_fail( int cipher_id, int pad_mode, int key_len,
TEST_ASSERT( ret == cipher_finish( &ctx, encbuf + outlen, &outlen ) );
/* done */
exit:
cipher_free( &ctx );
}
/* END_CASE */
......@@ -308,6 +310,7 @@ void dec_empty_buf()
&ctx_dec, decbuf + outlen, &outlen ) );
TEST_ASSERT( 0 == outlen );
exit:
cipher_free( &ctx_dec );
}
/* END_CASE */
......@@ -397,6 +400,7 @@ void enc_dec_buf_multipart( int cipher_id, int key_len, int first_length_val,
TEST_ASSERT( 0 == memcmp(inbuf, decbuf, length) );
exit:
cipher_free( &ctx_dec );
cipher_free( &ctx_enc );
}
......@@ -479,6 +483,7 @@ void decrypt_test_vec( int cipher_id, int pad_mode,
TEST_ASSERT( 0 == memcmp( output, clear, clear_len ) );
}
exit:
cipher_free( &ctx );
}
/* END_CASE */
......@@ -536,7 +541,7 @@ void auth_crypt_tv( int cipher_id, char *hex_key, char *hex_iv,
if( strcmp( hex_clear, "FAIL" ) == 0 )
{
TEST_ASSERT( ret == POLARSSL_ERR_CIPHER_AUTH_FAILED );
goto cleanup;
goto exit;
}
/* otherwise, make sure it was decrypted properly */
......@@ -566,7 +571,7 @@ void auth_crypt_tv( int cipher_id, char *hex_key, char *hex_iv,
TEST_ASSERT( my_tag[tag_len + 1] == 0xFF );
cleanup:
exit:
cipher_free( &ctx );
}
/* END_CASE */
......@@ -616,6 +621,7 @@ void test_vec_ecb( int cipher_id, int operation, char *hex_key,
TEST_ASSERT( 0 == memcmp( output, result,
cipher_get_block_size( &ctx ) ) );
exit:
cipher_free( &ctx );
}
/* END_CASE */
......@@ -634,6 +640,7 @@ void set_padding( int cipher_id, int pad_mode, int ret )
TEST_ASSERT( ret == cipher_set_padding_mode( &ctx, pad_mode ) );
exit:
cipher_free( &ctx );
}
/* END_CASE */
......
......@@ -46,6 +46,7 @@ void ctr_drbg_validate_pr( char *add_init_string, char *entropy_string,
hexify( output_str, buf, 16 );
TEST_ASSERT( strcmp( (char *) output_str, result_str ) == 0 );
exit:
ctr_drbg_free( &ctx );
}
/* END_CASE */
......@@ -82,6 +83,7 @@ void ctr_drbg_validate_nopr( char *add_init_string, char *entropy_string,
hexify( output_str, buf, 16 );
TEST_ASSERT( strcmp( (char *) output_str, result_str ) == 0 );
exit:
ctr_drbg_free( &ctx );
}
/* END_CASE */
......@@ -155,6 +157,7 @@ void ctr_drbg_entropy_usage( )
TEST_ASSERT( ctr_drbg_random( &ctx, out, sizeof( out ) ) == 0 );
TEST_ASSERT( test_offset_idx - last_idx == 13 );
exit:
ctr_drbg_free( &ctx );
}
/* END_CASE */
......@@ -168,6 +171,7 @@ void ctr_drbg_seed_file( char *path, int ret )
TEST_ASSERT( ctr_drbg_write_seed_file( &ctx, path ) == ret );
TEST_ASSERT( ctr_drbg_update_seed_file( &ctx, path ) == ret );
exit:
ctr_drbg_free( &ctx );
}
/* END_CASE */
......
......@@ -117,6 +117,7 @@ void debug_print_crt( int mode, char *crt_file, char *file, int line,
TEST_ASSERT( strcmp( buffer.buf, result_str ) == 0 );
exit:
x509_crt_free( &crt );
}
/* END_CASE */
......@@ -144,6 +145,7 @@ void debug_print_mpi( int mode, int radix, char *value, char *file, int line,
TEST_ASSERT( strcmp( buffer.buf, result_str ) == 0 );
exit:
mpi_free( &val );
}
/* END_CASE */
......@@ -45,6 +45,7 @@ void des_encrypt_ecb( char *hex_key_string, char *hex_src_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
des_free( &ctx );
}
/* END_CASE */
......@@ -74,6 +75,7 @@ void des_decrypt_ecb( char *hex_key_string, char *hex_src_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
des_free( &ctx );
}
/* END_CASE */
......@@ -110,6 +112,7 @@ void des_encrypt_cbc( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
des_free( &ctx );
}
/* END_CASE */
......@@ -146,6 +149,7 @@ void des_decrypt_cbc( char *hex_key_string, char *hex_iv_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
des_free( &ctx );
}
/* END_CASE */
......@@ -181,6 +185,7 @@ void des3_encrypt_ecb( int key_count, char *hex_key_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
des3_free( &ctx );
}
/* END_CASE */
......@@ -216,6 +221,7 @@ void des3_decrypt_ecb( int key_count, char *hex_key_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
exit:
des3_free( &ctx );
}
/* END_CASE */
......@@ -260,6 +266,7 @@ void des3_encrypt_cbc( int key_count, char *hex_key_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
des3_free( &ctx );
}
/* END_CASE */
......@@ -304,6 +311,7 @@ void des3_decrypt_cbc( int key_count, char *hex_key_string,
TEST_ASSERT( strcasecmp( (char *) dst_str, hex_dst_string ) == 0 );
}
exit:
des3_free( &ctx );
}
/* END_CASE */
......
......@@ -92,6 +92,7 @@ void dhm_do_dhm( int radix_P, char *input_P,
TEST_ASSERT( sec_srv_len != 0 );
TEST_ASSERT( memcmp( sec_srv, sec_cli, sec_srv_len ) == 0 );
exit:
dhm_free( &ctx_srv );
dhm_free( &ctx_cli );
}
......@@ -115,6 +116,7 @@ void dhm_file( char *filename, char *p, char *g, int len )
TEST_ASSERT( mpi_cmp_mpi( &ctx.P, &P ) == 0 );
TEST_ASSERT( mpi_cmp_mpi( &ctx.G, &G ) == 0 );
exit:
mpi_free( &P ); mpi_free( &G );
dhm_free( &ctx );
}
......
......@@ -34,6 +34,7 @@ void ecdh_primitive_random( int id )
TEST_ASSERT( mpi_cmp_mpi( &zA, &zB ) == 0 );
exit:
ecp_group_free( &grp );
ecp_point_free( &qA ); ecp_point_free( &qB );
mpi_free( &dA ); mpi_free( &dB );
......@@ -114,6 +115,7 @@ void ecdh_primitive_testvec( int id, char *dA_str, char *xA_str, char *yA_str,
TEST_ASSERT( ecdh_compute_shared( &grp, &zB, &qA, &dB, NULL, NULL ) == 0 );
TEST_ASSERT( mpi_cmp_mpi( &zB, &check ) == 0 );
exit:
ecp_group_free( &grp );
ecp_point_free( &qA ); ecp_point_free( &qB );
mpi_free( &dA ); mpi_free( &dB );
......@@ -151,6 +153,7 @@ void ecdh_exchange( int id )
TEST_ASSERT( ecdh_calc_secret( &cli, &len, buf, 1000, NULL, NULL ) == 0 );
TEST_ASSERT( mpi_cmp_mpi( &srv.z, &cli.z ) == 0 );
exit:
ecdh_free( &srv );
ecdh_free( &cli );
}
......
......@@ -32,6 +32,7 @@ void ecdsa_prim_random( int id )
&rnd_pseudo_rand, &rnd_info ) == 0 );
TEST_ASSERT( ecdsa_verify( &grp, buf, sizeof( buf ), &Q, &r, &s ) == 0 );
exit:
ecp_group_free( &grp );
ecp_point_free( &Q );
mpi_free( &d ); mpi_free( &r ); mpi_free( &s );
......@@ -86,6 +87,7 @@ void ecdsa_prim_test_vectors( int id, char *d_str, char *xQ_str, char *yQ_str,
TEST_ASSERT( ecdsa_verify( &grp, hash, hlen, &Q, &r_check, &s_check ) == 0 );
exit:
ecp_group_free( &grp );
ecp_point_free( &Q );
mpi_free( &d ); mpi_free( &r ); mpi_free( &s );
......@@ -123,6 +125,7 @@ void ecdsa_det_test_vectors( int id, char *d_str, int md_alg,
TEST_ASSERT( mpi_cmp_mpi( &r, &r_check ) == 0 );
TEST_ASSERT( mpi_cmp_mpi( &s, &s_check ) == 0 );
exit:
ecp_group_free( &grp );
mpi_free( &d ); mpi_free( &r ); mpi_free( &s );
mpi_free( &r_check ); mpi_free( &s_check );
......@@ -183,6 +186,7 @@ void ecdsa_write_read_random( int id )
sig, sig_len ) != 0 );
sig[sig_len - 1]--;
exit:
ecdsa_free( &ctx );
}
/* END_CASE */
......@@ -215,6 +219,7 @@ void ecdsa_write_read_det_random( int id, int md_alg )
TEST_ASSERT( ecdsa_read_signature( &ctx, hash, sizeof( hash ),
sig, sig_len ) == 0 );
exit:
ecdsa_free( &ctx );
}
/* END_CASE */
......@@ -71,6 +71,7 @@ void ecp_small_add( int a_zero, char *x_a, char *y_a, int b_zero, char *x_b,
TEST_ASSERT( mpi_cmp_int( &C.Y, y_c ) == 0 );
}
exit:
ecp_group_free( &grp );
ecp_point_free( &A ); ecp_point_free( &B ); ecp_point_free( &C );
}
......@@ -109,6 +110,7 @@ void ecp_small_sub( int a_zero, char *x_a, char *y_a, int b_zero, char *x_b,
TEST_ASSERT( mpi_cmp_int( &C.Y, y_c ) == 0 );
}
exit:
ecp_group_free( &grp );
ecp_point_free( &A ); ecp_point_free( &B ); ecp_point_free( &C );
}
......@@ -162,6 +164,7 @@ void ecp_small_mul( int m_str, int r_zero, int x_r, int y_r, int ret )
}
}
exit:
ecp_group_free( &grp );
ecp_point_free( &R );
mpi_free( &m );
......@@ -186,6 +189,7 @@ void ecp_small_check_pub( int x, int y, int z, int ret )
TEST_ASSERT( ecp_check_pubkey( &grp, &P ) == ret );
exit:
ecp_group_free( &grp );
ecp_point_free( &P );
}
......@@ -207,6 +211,7 @@ void ecp_check_pub_mx( int grp_id, char *key_hex, int ret )
TEST_ASSERT( ecp_check_pubkey( &grp, &P ) == ret );
exit:
ecp_group_free( &grp );
ecp_point_free( &P );
}
......@@ -260,6 +265,7 @@ void ecp_test_vect( int id, char *dA_str, char *xA_str, char *yA_str,
TEST_ASSERT( mpi_cmp_mpi( &R.Y, &yZ ) == 0 );
TEST_ASSERT( ecp_check_pubkey( &grp, &R ) == 0 );
exit:
ecp_group_free( &grp ); ecp_point_free( &R );
mpi_free( &dA ); mpi_free( &xA ); mpi_free( &yA ); mpi_free( &dB );
mpi_free( &xB ); mpi_free( &yB ); mpi_free( &xZ ); mpi_free( &yZ );
......@@ -309,6 +315,7 @@ void ecp_test_vec_x( int id, char *dA_hex, char *xA_hex,
TEST_ASSERT( ecp_check_pubkey( &grp, &R ) == 0 );
TEST_ASSERT( mpi_cmp_mpi( &R.X, &xS ) == 0 );
exit:
ecp_group_free( &grp ); ecp_point_free( &R );
mpi_free( &dA ); mpi_free( &xA );
mpi_free( &dB ); mpi_free( &xB );
......@@ -343,6 +350,7 @@ void ecp_fast_mod( int id, char *N_str )
TEST_ASSERT( mpi_mod_mpi( &N, &N, &grp.P ) == 0 );
TEST_ASSERT( mpi_cmp_mpi( &N, &R ) == 0 );
exit:
mpi_free( &N ); mpi_free( &R );
ecp_group_free( &grp );
}
......@@ -377,6 +385,7 @@ void ecp_write_binary( int id, char *x, char *y, char *z, int format,
TEST_ASSERT( strcasecmp( (char *) str, out ) == 0 );
}
exit:
ecp_group_free( &grp ); ecp_point_free( &P );
}
/* END_CASE */
......@@ -413,6 +422,7 @@ void ecp_read_binary( int id, char *input, char *x, char *y, char *z,
TEST_ASSERT( mpi_cmp_mpi( &P.Z, &Z ) == 0 );
}
exit:
ecp_group_free( &grp ); ecp_point_free( &P );
mpi_free( &X ); mpi_free( &Y ); mpi_free( &Z );
}
......@@ -452,6 +462,7 @@ void ecp_tls_read_point( int id, char *input, char *x, char *y, char *z,
TEST_ASSERT( *vbuf == 0x00 );
}
exit:
ecp_group_free( &grp ); ecp_point_free( &P );
mpi_free( &X ); mpi_free( &Y ); mpi_free( &Z );
}
......@@ -503,6 +514,7 @@ void ecp_tls_write_read_point( int id )
TEST_ASSERT( ecp_is_zero( &pt ) );
TEST_ASSERT( vbuf == buf + olen );
exit:
ecp_group_free( &grp );
ecp_point_free( &pt );
}
......@@ -530,6 +542,7 @@ void ecp_tls_read_group( char *record, int result, int bits )
TEST_ASSERT( *vbuf == 0x00 );
}
exit:
ecp_group_free( &grp );
}
/* END_CASE */
......@@ -559,6 +572,7 @@ void ecp_tls_write_read_group( int id )
TEST_ASSERT( grp1.id == grp2.id );
}
exit:
ecp_group_free( &grp1 );
ecp_group_free( &grp2 );
}
......@@ -578,6 +592,7 @@ void ecp_check_privkey( int id, char *key_hex, int ret )
TEST_ASSERT( ecp_check_privkey( &grp, &d ) == ret );
exit:
ecp_group_free( &grp );
mpi_free( &d );
}
......@@ -604,6 +619,7 @@ void ecp_gen_keypair( int id )
TEST_ASSERT( ecp_check_pubkey( &grp, &Q ) == 0 );
TEST_ASSERT( ecp_check_privkey( &grp, &d ) == 0 );
exit:
ecp_group_free( &grp );
ecp_point_free( &Q );
mpi_free( &d );
......@@ -624,6 +640,7 @@ void ecp_gen_key( int id )
TEST_ASSERT( ecp_check_pubkey( &key.grp, &key.Q ) == 0 );
TEST_ASSERT( ecp_check_privkey( &key.grp, &key.d ) == 0 );
exit:
ecp_keypair_free( &key );
}
/* END_CASE */
......
......@@ -50,6 +50,7 @@ void entropy_seed_file( char *path, int ret )
TEST_ASSERT( entropy_write_seed_file( &ctx, path ) == ret );
TEST_ASSERT( entropy_update_seed_file( &ctx, path ) == ret );
exit:
entropy_free( &ctx );
}
/* END_CASE */
......@@ -72,6 +73,7 @@ void entropy_too_many_sources( )
TEST_ASSERT( entropy_add_source( &ctx, entropy_dummy_source, NULL, 16 )
== POLARSSL_ERR_ENTROPY_MAX_SOURCES );
exit:
entropy_free( &ctx );
}
/* END_CASE */
......@@ -130,6 +132,7 @@ void entropy_source_fail( char *path )
((void) path);
#endif
exit:
entropy_free( &ctx );
}
/* END_CASE */
......@@ -159,6 +162,7 @@ void entropy_threshold( int threshold, int chunk_size, int result )
TEST_ASSERT( ret == result );
}
exit:
entropy_free( &ctx );
}
/* END_CASE */
......
......@@ -51,6 +51,7 @@ void gcm_encrypt_and_tag( int cipher_id,
TEST_ASSERT( strcmp( (char *) tag_str, hex_tag_string ) == 0 );
}
exit: