1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Adapt programs / test suites to _init() and _free()

This commit is contained in:
Paul Bakker
2014-06-18 11:16:11 +02:00
parent c7ea99af4f
commit 8cfd9d8c59
9 changed files with 113 additions and 2 deletions

View File

@ -93,6 +93,8 @@ int main( int argc, char *argv[] )
off_t filesize, offset;
#endif
aes_init( &aes_ctx );
/*
* Parse the command-line arguments.
*/
@ -357,7 +359,7 @@ int main( int argc, char *argv[] )
}
memset( key, 0, sizeof( key ) );
aes_setkey_dec( &aes_ctx, digest, 256 );
aes_setkey_dec( &aes_ctx, digest, 256 );
sha256_hmac_starts( &sha_ctx, digest, 32, 0 );
/*
@ -426,7 +428,7 @@ exit:
memset( buffer, 0, sizeof( buffer ) );
memset( digest, 0, sizeof( digest ) );
memset( &aes_ctx, 0, sizeof( aes_context ) );
aes_free( &aes_ctx );
memset( &sha_ctx, 0, sizeof( sha256_context ) );
return( ret );