mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Adapt programs / test suites to _init() and _free()
This commit is contained in:
parent
c7ea99af4f
commit
8cfd9d8c59
9 changed files with 113 additions and 2 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue