Adapt programs / test suites

This commit is contained in:
Paul Bakker
2014-07-01 15:45:49 +02:00
parent 84bbeb58df
commit d2a2d61a68
6 changed files with 65 additions and 47 deletions

View File

@@ -22,6 +22,8 @@ void pbkdf2_hmac( int hash, char *hex_password_string,
int pw_len, salt_len;
unsigned char key[100];
md_init( &ctx );
memset(pw_str, 0x00, 100);
memset(salt_str, 0x00, 100);
memset(dst_str, 0x00, 100);
@@ -37,7 +39,7 @@ 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 );
TEST_ASSERT( md_free_ctx( &ctx ) == 0 );
md_free( &ctx );
hexify( dst_str, key, key_len );
TEST_ASSERT( strcmp( (char *) dst_str, result_key_string ) == 0 );