Rename get_pk_type_and_md_alg

The function is for both tls12 and tls13 now.

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2022-07-23 11:37:50 +08:00
parent eec4f03c60
commit 95b743ca17
3 changed files with 4 additions and 4 deletions

View file

@ -2092,7 +2092,7 @@ static inline int mbedtls_ssl_sig_alg_is_offered( const mbedtls_ssl_context *ssl
return( 0 ); return( 0 );
} }
static inline int mbedtls_ssl_tls13_get_pk_type_and_md_alg_from_sig_alg( static inline int mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg(
uint16_t sig_alg, mbedtls_pk_type_t *pk_type, mbedtls_md_type_t *md_alg ) uint16_t sig_alg, mbedtls_pk_type_t *pk_type, mbedtls_md_type_t *md_alg )
{ {
*pk_type = mbedtls_ssl_pk_alg_from_sig( sig_alg & 0xff ); *pk_type = mbedtls_ssl_pk_alg_from_sig( sig_alg & 0xff );

View file

@ -2359,7 +2359,7 @@ start_processing:
*/ */
MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, 2 ); MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, 2 );
sig_alg = MBEDTLS_GET_UINT16_BE( p, 0 ); sig_alg = MBEDTLS_GET_UINT16_BE( p, 0 );
if( mbedtls_ssl_tls13_get_pk_type_and_md_alg_from_sig_alg( if( mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg(
sig_alg, &pk_alg, &md_alg ) != 0 && sig_alg, &pk_alg, &md_alg ) != 0 &&
! mbedtls_ssl_sig_alg_is_offered( ssl, sig_alg ) && ! mbedtls_ssl_sig_alg_is_offered( ssl, sig_alg ) &&
! mbedtls_ssl_sig_alg_is_supported( ssl, sig_alg ) ) ! mbedtls_ssl_sig_alg_is_supported( ssl, sig_alg ) )

View file

@ -213,7 +213,7 @@ static int ssl_tls13_parse_certificate_verify( mbedtls_ssl_context *ssl,
goto error; goto error;
} }
if( mbedtls_ssl_tls13_get_pk_type_and_md_alg_from_sig_alg( if( mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg(
algorithm, &sig_alg, &md_alg ) != 0 ) algorithm, &sig_alg, &md_alg ) != 0 )
{ {
goto error; goto error;
@ -1029,7 +1029,7 @@ static int ssl_tls13_write_certificate_verify_body( mbedtls_ssl_context *ssl,
MBEDTLS_SSL_DEBUG_MSG( 2, ( "CertificateVerify with %s", MBEDTLS_SSL_DEBUG_MSG( 2, ( "CertificateVerify with %s",
mbedtls_ssl_sig_alg_to_str( algorithm )) ); mbedtls_ssl_sig_alg_to_str( algorithm )) );
if( mbedtls_ssl_tls13_get_pk_type_and_md_alg_from_sig_alg( if( mbedtls_ssl_get_pk_type_and_md_alg_from_sig_alg(
algorithm, &pk_type, &md_alg ) != 0 ) algorithm, &pk_type, &md_alg ) != 0 )
{ {
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );