mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Rename constant-time functions to have mbedtls_ct prefix
Rename functions to better suite with the module name. Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
@ -198,7 +198,7 @@ static int ssl_parse_renegotiation_info( mbedtls_ssl_context *ssl,
|
||||
/* Check verify-data in constant-time. The length OTOH is no secret */
|
||||
if( len != 1 + ssl->verify_data_len ||
|
||||
buf[0] != ssl->verify_data_len ||
|
||||
mbedtls_cf_memcmp( buf + 1, ssl->peer_verify_data,
|
||||
mbedtls_ct_memcmp( buf + 1, ssl->peer_verify_data,
|
||||
ssl->verify_data_len ) != 0 )
|
||||
{
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-matching renegotiation info" ) );
|
||||
@ -3973,7 +3973,7 @@ static int ssl_parse_encrypted_pms( mbedtls_ssl_context *ssl,
|
||||
diff |= peer_pms[1] ^ ver[1];
|
||||
|
||||
/* mask = diff ? 0xff : 0x00 using bit operations to avoid branches */
|
||||
mask = mbedtls_cf_uint_mask( diff );
|
||||
mask = mbedtls_ct_uint_mask( diff );
|
||||
|
||||
/*
|
||||
* Protection against Bleichenbacher's attack: invalid PKCS#1 v1.5 padding
|
||||
@ -4056,7 +4056,7 @@ static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha
|
||||
/* Identity is not a big secret since clients send it in the clear,
|
||||
* but treat it carefully anyway, just in case */
|
||||
if( n != ssl->conf->psk_identity_len ||
|
||||
mbedtls_cf_memcmp( ssl->conf->psk_identity, *p, n ) != 0 )
|
||||
mbedtls_ct_memcmp( ssl->conf->psk_identity, *p, n ) != 0 )
|
||||
{
|
||||
ret = MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY;
|
||||
}
|
||||
|
Reference in New Issue
Block a user