mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 23:25:44 +01:00
Fix memleak with repeated [gc]cm_setkey()
This commit is contained in:
parent
bc07c3a1f0
commit
61977614d8
@ -35,6 +35,8 @@ Features
|
|||||||
errors on use of deprecated functions.
|
errors on use of deprecated functions.
|
||||||
|
|
||||||
Bugfix
|
Bugfix
|
||||||
|
* Fix memory leak when gcm_setkey() and ccm_setkey() are used more than
|
||||||
|
once on the same context.
|
||||||
* Fix bug in ssl_mail_client when password is longer that username (found
|
* Fix bug in ssl_mail_client when password is longer that username (found
|
||||||
by Bruno Pape).
|
by Bruno Pape).
|
||||||
* Fix undefined behaviour (memcmp( NULL, NULL, 0 );) in X.509 modules
|
* Fix undefined behaviour (memcmp( NULL, NULL, 0 );) in X.509 modules
|
||||||
|
@ -78,6 +78,8 @@ int ccm_init( ccm_context *ctx, cipher_id_t cipher,
|
|||||||
if( cipher_info->block_size != 16 )
|
if( cipher_info->block_size != 16 )
|
||||||
return( POLARSSL_ERR_CCM_BAD_INPUT );
|
return( POLARSSL_ERR_CCM_BAD_INPUT );
|
||||||
|
|
||||||
|
cipher_free( &ctx->cipher_ctx );
|
||||||
|
|
||||||
if( ( ret = cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 )
|
if( ( ret = cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
|
@ -168,6 +168,8 @@ int gcm_init( gcm_context *ctx, cipher_id_t cipher, const unsigned char *key,
|
|||||||
if( cipher_info->block_size != 16 )
|
if( cipher_info->block_size != 16 )
|
||||||
return( POLARSSL_ERR_GCM_BAD_INPUT );
|
return( POLARSSL_ERR_GCM_BAD_INPUT );
|
||||||
|
|
||||||
|
cipher_free( &ctx->cipher_ctx );
|
||||||
|
|
||||||
if( ( ret = cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 )
|
if( ( ret = cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user