mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 12:35:37 +00:00
HMAC_DRBG: clean stack buffers
Wipe stack buffers that may contain sensitive data (data that contributes to the DRBG state.
This commit is contained in:
parent
d9aa84dc0d
commit
afa803775a
|
@ -89,6 +89,8 @@ void mbedtls_hmac_drbg_update( mbedtls_hmac_drbg_context *ctx,
|
|||
mbedtls_md_hmac_update( &ctx->md_ctx, ctx->V, md_len );
|
||||
mbedtls_md_hmac_finish( &ctx->md_ctx, ctx->V );
|
||||
}
|
||||
|
||||
mbedtls_platform_zeroize( K, sizeof( K ) );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -154,6 +156,7 @@ int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx,
|
|||
ctx->reseed_counter = 1;
|
||||
|
||||
/* 4. Done */
|
||||
mbedtls_platform_zeroize( seed, seedlen );
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue