mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03: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:
@ -253,6 +253,12 @@ int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx,
|
||||
for( i = 0; i < 8; i++ )
|
||||
ctx->state[i] += A[i];
|
||||
|
||||
/* Zeroise buffers and variables to clear sensitive data from memory. */
|
||||
mbedtls_platform_zeroize( &A, sizeof( A ) );
|
||||
mbedtls_platform_zeroize( &W, sizeof( W ) );
|
||||
mbedtls_platform_zeroize( &temp1, sizeof( temp1 ) );
|
||||
mbedtls_platform_zeroize( &temp2, sizeof( temp2 ) );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user