move zeroize randbytes

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2021-12-08 13:28:49 +08:00
parent bdfd01835a
commit 2c70a39d97
2 changed files with 3 additions and 4 deletions

View File

@ -965,9 +965,6 @@ static int ssl_tls13_postprocess_server_finished_message( mbedtls_ssl_context *s
goto cleanup;
}
/* randbytes is not used again */
mbedtls_platform_zeroize( ssl->handshake->randbytes,
sizeof( ssl->handshake->randbytes ) );
transform_application =
mbedtls_calloc( 1, sizeof( mbedtls_ssl_transform ) );
if( transform_application == NULL )

View File

@ -1225,7 +1225,9 @@ int mbedtls_ssl_tls13_generate_application_keys(
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= derive application traffic keys" ) );
cleanup:
/* randbytes is not used again */
mbedtls_platform_zeroize( ssl->handshake->randbytes,
sizeof( ssl->handshake->randbytes ) );
mbedtls_platform_zeroize( transcript, sizeof( transcript ) );
return( ret );
}