mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Clear pk context and other minor changes in *_free() procedures
This commit is contained in:
parent
fcfa4c21c1
commit
2239a868f7
4 changed files with 29 additions and 15 deletions
|
|
@ -61,10 +61,11 @@ void mbedtls_pk_init( mbedtls_pk_context *ctx )
|
|||
*/
|
||||
void mbedtls_pk_free( mbedtls_pk_context *ctx )
|
||||
{
|
||||
if( ctx == NULL || ctx->pk_info == NULL )
|
||||
if( ctx == NULL )
|
||||
return;
|
||||
|
||||
ctx->pk_info->ctx_free_func( ctx->pk_ctx );
|
||||
if ( ctx->pk_info != NULL )
|
||||
ctx->pk_info->ctx_free_func( ctx->pk_ctx );
|
||||
|
||||
mbedtls_platform_zeroize( ctx, sizeof( mbedtls_pk_context ) );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue