1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-06-27 15:53:57 +08:00

Fix comments, code style, remove debug code

Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
Przemyslaw Stekiel 2022-02-03 10:44:02 +01:00
parent 6b2eedd25f
commit 8c010eb467
4 changed files with 18 additions and 17 deletions

View File

@ -2035,8 +2035,9 @@ static inline int mbedtls_ssl_sig_alg_is_supported(
* 0 - default tag length * 0 - default tag length
* \param alg [out] corresponding PSA alg * \param alg [out] corresponding PSA alg
* There is no corresponding PSA * There is no corresponding PSA
* alg for MBEDTLS_SSL_NULL_CIPHER, so * alg for MBEDTLS_CIPHER_NULL, so
* MBEDTLS_SSL_NULL_CIPHER is returned * in this case MBEDTLS_SSL_NULL_CIPHER
* is returned via this parameter
* \param key_type [out] corresponding PSA key type * \param key_type [out] corresponding PSA key type
* \param key_size [out] corresponding PSA key size * \param key_size [out] corresponding PSA key size
* *

View File

@ -2058,7 +2058,8 @@ static void ssl_write_encrypt_then_mac_ext( mbedtls_ssl_context *ssl,
if( ( suite = mbedtls_ssl_ciphersuite_from_id( if( ( suite = mbedtls_ssl_ciphersuite_from_id(
ssl->session_negotiate->ciphersuite ) ) == NULL || ssl->session_negotiate->ciphersuite ) ) == NULL ||
#if defined(MBEDTLS_USE_PSA_CRYPTO) #if defined(MBEDTLS_USE_PSA_CRYPTO)
( mbedtls_ssl_cipher_to_psa( suite->cipher, 0, &alg, &key_type, &key_bits ) != PSA_SUCCESS) || ( mbedtls_ssl_cipher_to_psa( suite->cipher, 0, &alg,
&key_type, &key_bits ) != PSA_SUCCESS ) ||
alg != PSA_ALG_CBC_NO_PADDING ) alg != PSA_ALG_CBC_NO_PADDING )
#else #else
( cipher = mbedtls_cipher_info_from_type( suite->cipher ) ) == NULL || ( cipher = mbedtls_cipher_info_from_type( suite->cipher ) ) == NULL ||

View File

@ -1475,10 +1475,9 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
&key_type, &key_type,
&key_bits ); &key_bits );
if ( status != PSA_SUCCESS) if ( status != PSA_SUCCESS )
{ {
ret = psa_ssl_status_to_mbedtls( status ); ret = psa_ssl_status_to_mbedtls( status );
mbedtls_fprintf( stderr, "mbedtls_ssl_cipher_to_psa: %d\n", (int)status);
goto cleanup; goto cleanup;
} }
@ -1496,7 +1495,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
PSA_BITS_TO_BYTES( key_bits ), PSA_BITS_TO_BYTES( key_bits ),
&t_in->psa_key_enc ); &t_in->psa_key_enc );
if ( status != PSA_SUCCESS) if ( status != PSA_SUCCESS )
{ {
ret = psa_ssl_status_to_mbedtls( status ); ret = psa_ssl_status_to_mbedtls( status );
goto cleanup; goto cleanup;
@ -1507,7 +1506,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
PSA_BITS_TO_BYTES( key_bits ), PSA_BITS_TO_BYTES( key_bits ),
&t_out->psa_key_enc ); &t_out->psa_key_enc );
if ( status != PSA_SUCCESS) if ( status != PSA_SUCCESS )
{ {
ret = psa_ssl_status_to_mbedtls( status ); ret = psa_ssl_status_to_mbedtls( status );
goto cleanup; goto cleanup;
@ -1520,7 +1519,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
PSA_BITS_TO_BYTES( key_bits ), PSA_BITS_TO_BYTES( key_bits ),
&t_in->psa_key_dec ); &t_in->psa_key_dec );
if ( status != PSA_SUCCESS) if ( status != PSA_SUCCESS )
{ {
ret = psa_ssl_status_to_mbedtls( status ); ret = psa_ssl_status_to_mbedtls( status );
goto cleanup; goto cleanup;
@ -1531,7 +1530,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
PSA_BITS_TO_BYTES( key_bits ), PSA_BITS_TO_BYTES( key_bits ),
&t_out->psa_key_dec ); &t_out->psa_key_dec );
if ( status != PSA_SUCCESS) if ( status != PSA_SUCCESS )
{ {
ret = psa_ssl_status_to_mbedtls( status ); ret = psa_ssl_status_to_mbedtls( status );
goto cleanup; goto cleanup;