1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Zeroize internal buffers and variables in MD hashes

Zeroising of local buffers and variables which are used for calculations in
mbedtls_internal_md*_process() and mbedtls_internal_ripemd160_process()
functions to erase sensitive data from memory.
Checked all function for possible missing zeroisation in MD.

Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
gabor-mezei-arm
2020-08-19 14:03:06 +02:00
parent 4553dd46d6
commit d1c98fcf5e
5 changed files with 32 additions and 1 deletions

View File

@ -237,6 +237,13 @@ int mbedtls_internal_md5_process( mbedtls_md5_context *ctx,
ctx->state[2] += C;
ctx->state[3] += D;
/* Zeroise variables to clear sensitive data from memory. */
mbedtls_platform_zeroize( &X, sizeof( X ) );
mbedtls_platform_zeroize( &A, sizeof( A ) );
mbedtls_platform_zeroize( &B, sizeof( B ) );
mbedtls_platform_zeroize( &C, sizeof( C ) );
mbedtls_platform_zeroize( &D, sizeof( D ) );
return( 0 );
}