mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Use -1 instead of 1 as failure return value in internal SSL function
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
@ -6999,14 +6999,14 @@ int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md )
|
|||||||
{
|
{
|
||||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||||
if( ssl->minor_ver != MBEDTLS_SSL_MINOR_VERSION_3 )
|
if( ssl->minor_ver != MBEDTLS_SSL_MINOR_VERSION_3 )
|
||||||
return( 1 );
|
return( -1 );
|
||||||
|
|
||||||
switch( md )
|
switch( md )
|
||||||
{
|
{
|
||||||
#if defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_PROTO_TLS1_1)
|
#if defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_PROTO_TLS1_1)
|
||||||
#if defined(MBEDTLS_MD5_C)
|
#if defined(MBEDTLS_MD5_C)
|
||||||
case MBEDTLS_SSL_HASH_MD5:
|
case MBEDTLS_SSL_HASH_MD5:
|
||||||
return( 1 );
|
return( -1 );
|
||||||
#endif
|
#endif
|
||||||
#if defined(MBEDTLS_SHA1_C)
|
#if defined(MBEDTLS_SHA1_C)
|
||||||
case MBEDTLS_SSL_HASH_SHA1:
|
case MBEDTLS_SSL_HASH_SHA1:
|
||||||
@ -7025,7 +7025,7 @@ int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md )
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
return( 1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -7033,7 +7033,7 @@ int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md )
|
|||||||
(void) ssl;
|
(void) ssl;
|
||||||
(void) md;
|
(void) md;
|
||||||
|
|
||||||
return( 1 );
|
return( -1 );
|
||||||
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
|
#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user