mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Remove uses of MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH
The error code MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH is only returned from the internal function ``` mbedtls_ssl_set_calc_verify_md() ``` Moreover, at every call-site of this function, it is only checked whether the return value is 0 or not, while the exact return value is irrelevant. The behavior the library is therefore unchanged if we return 1 instead of MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH in `mbedtls_ssl_set_calc_verify_md()`. This commit makes this change. Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
@ -6998,14 +6998,14 @@ int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md )
|
||||
{
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||
if( ssl->minor_ver != MBEDTLS_SSL_MINOR_VERSION_3 )
|
||||
return MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH;
|
||||
return( 1 );
|
||||
|
||||
switch( md )
|
||||
{
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_PROTO_TLS1_1)
|
||||
#if defined(MBEDTLS_MD5_C)
|
||||
case MBEDTLS_SSL_HASH_MD5:
|
||||
return MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH;
|
||||
return( 1 );
|
||||
#endif
|
||||
#if defined(MBEDTLS_SHA1_C)
|
||||
case MBEDTLS_SSL_HASH_SHA1:
|
||||
@ -7024,7 +7024,7 @@ int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md )
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH;
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -7032,7 +7032,7 @@ int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md )
|
||||
(void) ssl;
|
||||
(void) md;
|
||||
|
||||
return MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH;
|
||||
return( 1 );
|
||||
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user