fix various issues

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2022-01-17 18:16:35 +08:00
parent e12f1ddcfa
commit 713013fa80
4 changed files with 38 additions and 32 deletions

View file

@ -2803,10 +2803,10 @@ static int ssl_write_certificate_request( mbedtls_ssl_context *ssl )
for( ; *sig_alg != MBEDTLS_TLS1_3_SIG_NONE; sig_alg++ )
{
/* High byte is hash */
unsigned char hash = ( *sig_alg >> 8 ) & 0xff;
unsigned char sig = ( *sig_alg ) & 0xff;
unsigned char hash = MBEDTLS_BYTE_1( *sig_alg );
unsigned char sig = MBEDTLS_BYTE_0( *sig_alg );
if( MBEDTLS_SSL_HASH_NONE == hash || mbedtls_ssl_set_calc_verify_md( ssl, hash ) )
if( mbedtls_ssl_set_calc_verify_md( ssl, hash ) )
continue;
#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_ECDSA_C)
if( sig != MBEDTLS_SSL_SIG_RSA && sig != MBEDTLS_SSL_SIG_ECDSA )