Refactor certificate request
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
9eba750916
commit
6d0e78ba22
1 changed files with 6 additions and 9 deletions
|
@ -2184,7 +2184,7 @@ static int ssl_tls13_parse_certificate_request( mbedtls_ssl_context *ssl,
|
||||||
MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, extensions_len );
|
MBEDTLS_SSL_CHK_BUF_READ_PTR( p, end, extensions_len );
|
||||||
extensions_end = p + extensions_len;
|
extensions_end = p + extensions_len;
|
||||||
|
|
||||||
handshake->received_extensions = MBEDTLS_SSL_EXT_NONE;
|
handshake->received_extensions = MBEDTLS_SSL_EXT_MASK_NONE;
|
||||||
|
|
||||||
while( p < extensions_end )
|
while( p < extensions_end )
|
||||||
{
|
{
|
||||||
|
@ -2217,19 +2217,16 @@ static int ssl_tls13_parse_certificate_request( mbedtls_ssl_context *ssl,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 3,
|
MBEDTLS_SSL_PRINT_EXT_TYPE(
|
||||||
( "certificate request: received %s(%u) extension ( ignored )",
|
3, MBEDTLS_SSL_HS_CERTIFICATE_REQUEST,
|
||||||
mbedtls_tls13_get_extension_name( extension_type ),
|
extension_type, "( ignored )" );
|
||||||
extension_type ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
p += extension_data_len;
|
p += extension_data_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
MBEDTLS_SSL_TLS1_3_PRINT_EXTS( 3,
|
MBEDTLS_SSL_PRINT_RECEIVED_EXTS( 3, MBEDTLS_SSL_HS_CERTIFICATE_REQUEST );
|
||||||
MBEDTLS_SSL_HS_CERTIFICATE_REQUEST,
|
|
||||||
handshake->received_extensions );
|
|
||||||
|
|
||||||
/* Check that we consumed all the message. */
|
/* Check that we consumed all the message. */
|
||||||
if( p != end )
|
if( p != end )
|
||||||
|
@ -2243,7 +2240,7 @@ static int ssl_tls13_parse_certificate_request( mbedtls_ssl_context *ssl,
|
||||||
*
|
*
|
||||||
* The "signature_algorithms" extension MUST be specified
|
* The "signature_algorithms" extension MUST be specified
|
||||||
*/
|
*/
|
||||||
if( ( handshake->received_extensions & MBEDTLS_SSL_EXT_SIG_ALG ) == 0 )
|
if( ( handshake->received_extensions & MBEDTLS_SSL_EXT_MASK( SIG_ALG ) ) == 0 )
|
||||||
{
|
{
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 3,
|
MBEDTLS_SSL_DEBUG_MSG( 3,
|
||||||
( "no signature algorithms extension found" ) );
|
( "no signature algorithms extension found" ) );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue