mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Zeroize internal buffers and variables in PKCS and SHA
Zeroising of local buffers and variables which are used for calculations in mbedtls_pkcs5_pbkdf2_hmac() and mbedtls_internal_sha*_process() functions to erase sensitive data from memory. Checked all function for possible missing zeroisation in PKCS and SHA. Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
parent
fa3b3e0d88
commit
d5253bba32
5 changed files with 37 additions and 0 deletions
|
|
@ -313,6 +313,15 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx,
|
|||
ctx->state[3] += D;
|
||||
ctx->state[4] += E;
|
||||
|
||||
/* Zeroise buffers and variables to clear sensitive data from memory. */
|
||||
mbedtls_platform_zeroize( &A, sizeof( A ) );
|
||||
mbedtls_platform_zeroize( &B, sizeof( B ) );
|
||||
mbedtls_platform_zeroize( &C, sizeof( C ) );
|
||||
mbedtls_platform_zeroize( &D, sizeof( D ) );
|
||||
mbedtls_platform_zeroize( &E, sizeof( E ) );
|
||||
mbedtls_platform_zeroize( &W, sizeof( W ) );
|
||||
mbedtls_platform_zeroize( &temp, sizeof( temp ) );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue