mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-27 10:14:25 +01: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
d324c5954a
commit
1da7776bd7
@ -93,6 +93,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_update( &ctx->md_ctx, ctx->V, md_len );
|
||||||
mbedtls_md_hmac_finish( &ctx->md_ctx, ctx->V );
|
mbedtls_md_hmac_finish( &ctx->md_ctx, ctx->V );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mbedtls_zeroize( K, sizeof( K ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -158,6 +160,7 @@ int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx,
|
|||||||
ctx->reseed_counter = 1;
|
ctx->reseed_counter = 1;
|
||||||
|
|
||||||
/* 4. Done */
|
/* 4. Done */
|
||||||
|
mbedtls_zeroize( seed, seedlen );
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user