fix format and comment issues
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
b25d10f153
commit
6cf6b47b5c
4 changed files with 10 additions and 10 deletions
|
@ -1710,7 +1710,7 @@ int mbedtls_ssl_set_hs_psk( mbedtls_ssl_context *ssl,
|
||||||
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_2)
|
||||||
if( ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_2 )
|
if( ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_2 )
|
||||||
{
|
{
|
||||||
if( ssl->handshake->ciphersuite_info->mac == MBEDTLS_MD_SHA384)
|
if( ssl->handshake->ciphersuite_info->mac == MBEDTLS_MD_SHA384 )
|
||||||
alg = PSA_ALG_TLS12_PSK_TO_MS( PSA_ALG_SHA_384 );
|
alg = PSA_ALG_TLS12_PSK_TO_MS( PSA_ALG_SHA_384 );
|
||||||
else
|
else
|
||||||
alg = PSA_ALG_TLS12_PSK_TO_MS( PSA_ALG_SHA_256 );
|
alg = PSA_ALG_TLS12_PSK_TO_MS( PSA_ALG_SHA_256 );
|
||||||
|
|
|
@ -359,7 +359,7 @@ int mbedtls_ssl_tls13_evolve_secret(
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
if( ( input != NULL ) && ( input_len != 0 ) )
|
if( input != NULL && input_len != 0 )
|
||||||
{
|
{
|
||||||
memcpy( tmp_input, input, input_len );
|
memcpy( tmp_input, input, input_len );
|
||||||
ilen = input_len;
|
ilen = input_len;
|
||||||
|
@ -1579,7 +1579,7 @@ int mbedtls_ssl_tls13_export_handshake_psk( mbedtls_ssl_context *ssl,
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
||||||
status = psa_get_key_attributes( ssl->handshake->psk_opaque, &key_attributes );
|
status = psa_get_key_attributes( ssl->handshake->psk_opaque, &key_attributes );
|
||||||
if( status != PSA_SUCCESS)
|
if( status != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
return( psa_ssl_status_to_mbedtls( status ) );
|
return( psa_ssl_status_to_mbedtls( status ) );
|
||||||
}
|
}
|
||||||
|
@ -1593,7 +1593,7 @@ int mbedtls_ssl_tls13_export_handshake_psk( mbedtls_ssl_context *ssl,
|
||||||
|
|
||||||
status = psa_export_key( ssl->handshake->psk_opaque,
|
status = psa_export_key( ssl->handshake->psk_opaque,
|
||||||
(uint8_t *)*psk, *psk_len, psk_len );
|
(uint8_t *)*psk, *psk_len, psk_len );
|
||||||
if( status != PSA_SUCCESS)
|
if( status != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
mbedtls_free( (void *)*psk );
|
mbedtls_free( (void *)*psk );
|
||||||
return( psa_ssl_status_to_mbedtls( status ) );
|
return( psa_ssl_status_to_mbedtls( status ) );
|
||||||
|
|
|
@ -693,12 +693,12 @@ MBEDTLS_CHECK_RETURN_CRITICAL
|
||||||
int mbedtls_ssl_tls13_compute_application_transform( mbedtls_ssl_context *ssl );
|
int mbedtls_ssl_tls13_compute_application_transform( mbedtls_ssl_context *ssl );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Export TLS 1.3 PSK key from handshake context
|
* \brief Export TLS 1.3 PSK from handshake context
|
||||||
*
|
*
|
||||||
* \param ssl The SSL context to operate on.
|
* \param ssl The SSL context to operate on.
|
||||||
* \param psk PSK key output pointer.
|
* \param psk PSK output pointer.
|
||||||
* \param psk_len
|
* \param psk_len
|
||||||
* Length of PSK key.
|
* Length of PSK.
|
||||||
*
|
*
|
||||||
* \returns \c 0 on success.
|
* \returns \c 0 on success.
|
||||||
* \returns A negative error code on failure.
|
* \returns A negative error code on failure.
|
||||||
|
|
|
@ -1057,9 +1057,9 @@ static int ssl_tls13_parse_client_hello( mbedtls_ssl_context *ssl,
|
||||||
ciphersuite_info == NULL ?
|
ciphersuite_info == NULL ?
|
||||||
"Unkown": ciphersuite_info->name ) );
|
"Unkown": ciphersuite_info->name ) );
|
||||||
}
|
}
|
||||||
#else
|
#else /* MBEDTLS_DEBUG_C */
|
||||||
p = cipher_suites_end;
|
p = cipher_suites_end;
|
||||||
#endif /* MBEDTLS_DEBUG_C */
|
#endif /* !MBEDTLS_DEBUG_C */
|
||||||
|
|
||||||
/* ...
|
/* ...
|
||||||
* opaque legacy_compression_methods<1..2^8-1>;
|
* opaque legacy_compression_methods<1..2^8-1>;
|
||||||
|
@ -1331,7 +1331,7 @@ static int ssl_tls13_parse_client_hello( mbedtls_ssl_context *ssl,
|
||||||
* Search for a matching ciphersuite
|
* Search for a matching ciphersuite
|
||||||
*/
|
*/
|
||||||
for ( const unsigned char * p_chiper_suite = cipher_suites ;
|
for ( const unsigned char * p_chiper_suite = cipher_suites ;
|
||||||
p_chiper_suite < cipher_suites_end; p_chiper_suite += 2 )
|
p_chiper_suite < cipher_suites_end; p_chiper_suite += 2 )
|
||||||
{
|
{
|
||||||
uint16_t cipher_suite;
|
uint16_t cipher_suite;
|
||||||
const mbedtls_ssl_ciphersuite_t* ciphersuite_info;
|
const mbedtls_ssl_ciphersuite_t* ciphersuite_info;
|
||||||
|
|
Loading…
Reference in a new issue