Update code base on comments
Change-Id: Ibc5043154515d2801565a2b99741dfda1344211c Signed-off-by: XiaokangQian <xiaokang.qian@arm.com>
This commit is contained in:
parent
a987e1d2f8
commit
aad9b0a286
2 changed files with 1 additions and 9 deletions
|
@ -8085,14 +8085,10 @@ int mbedtls_ssl_write_sig_alg_ext( mbedtls_ssl_context *ssl, unsigned char *buf,
|
||||||
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write extension_type */
|
|
||||||
MBEDTLS_PUT_UINT16_BE( MBEDTLS_TLS_EXT_SIG_ALG, buf, 0 );
|
MBEDTLS_PUT_UINT16_BE( MBEDTLS_TLS_EXT_SIG_ALG, buf, 0 );
|
||||||
/* Write extension_data_length */
|
|
||||||
MBEDTLS_PUT_UINT16_BE( supported_sig_alg_len + 2, buf, 2 );
|
MBEDTLS_PUT_UINT16_BE( supported_sig_alg_len + 2, buf, 2 );
|
||||||
/* Write length of supported_signature_algorithms */
|
|
||||||
MBEDTLS_PUT_UINT16_BE( supported_sig_alg_len, buf, 4 );
|
MBEDTLS_PUT_UINT16_BE( supported_sig_alg_len, buf, 4 );
|
||||||
|
|
||||||
/* Output the total length of signature algorithms extension. */
|
|
||||||
*out_len = p - buf;
|
*out_len = p - buf;
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||||
|
|
|
@ -1140,14 +1140,11 @@ static int ssl_tls13_write_encrypted_extensions( mbedtls_ssl_context *ssl )
|
||||||
MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_finish_handshake_msg(
|
MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_finish_handshake_msg(
|
||||||
ssl, buf_len, msg_len ) );
|
ssl, buf_len, msg_len ) );
|
||||||
|
|
||||||
/* Update state */
|
|
||||||
#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
|
#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED)
|
||||||
if( mbedtls_ssl_tls13_some_psk_enabled( ssl ) )
|
if( mbedtls_ssl_tls13_some_psk_enabled( ssl ) )
|
||||||
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_SERVER_FINISHED );
|
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_SERVER_FINISHED );
|
||||||
else
|
else
|
||||||
{
|
|
||||||
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CERTIFICATE_REQUEST );
|
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_CERTIFICATE_REQUEST );
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_SERVER_FINISHED );
|
mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_SERVER_FINISHED );
|
||||||
#endif
|
#endif
|
||||||
|
@ -1226,9 +1223,8 @@ static int ssl_tls13_write_certificate_request_body( mbedtls_ssl_context *ssl,
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
/* length field for all extensions */
|
|
||||||
MBEDTLS_PUT_UINT16_BE( output_len, p_extensions_len, 0 );
|
|
||||||
p += output_len;
|
p += output_len;
|
||||||
|
MBEDTLS_PUT_UINT16_BE( p - p_extensions_len - 2, p_extensions_len, 0 );
|
||||||
|
|
||||||
*out_len = p - buf;
|
*out_len = p - buf;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue