Remove directly access for tls13_sig_algs

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2021-12-22 10:53:23 +08:00
parent afdfed16d0
commit 08e2ceae18

View file

@ -179,7 +179,7 @@ int mbedtls_ssl_tls13_write_sig_alg_ext( mbedtls_ssl_context *ssl,
* Write supported_signature_algorithms
*/
supported_sig_alg = p;
for( const uint16_t *sig_alg = ssl->conf->tls13_sig_algs;
for( const uint16_t *sig_alg = mbedtls_ssl_conf_get_sig_algs( ssl->conf );
*sig_alg != MBEDTLS_TLS1_3_SIG_NONE; sig_alg++ )
{
MBEDTLS_SSL_CHK_BUF_PTR( p, end, 2 );
@ -284,13 +284,12 @@ static void ssl_tls13_create_verify_structure( const unsigned char *transcript_h
}
static int ssl_tls13_sig_alg_is_offered( const mbedtls_ssl_context *ssl,
uint16_t sig_alg )
uint16_t received_sig_alg )
{
const uint16_t *tls13_sig_alg = ssl->conf->tls13_sig_algs;
for( ; *tls13_sig_alg != MBEDTLS_TLS1_3_SIG_NONE ; tls13_sig_alg++ )
for( const uint16_t *sig_alg = mbedtls_ssl_conf_get_sig_algs( ssl->conf );
*sig_alg != MBEDTLS_TLS1_3_SIG_NONE; sig_alg++ )
{
if( *tls13_sig_alg == sig_alg )
if( *sig_alg == received_sig_alg )
return( 1 );
}
return( 0 );