mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Fix comments, code style, remove debug code
Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
@ -1475,10 +1475,9 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
|
||||
&key_type,
|
||||
&key_bits );
|
||||
|
||||
if ( status != PSA_SUCCESS)
|
||||
if ( status != PSA_SUCCESS )
|
||||
{
|
||||
ret = psa_ssl_status_to_mbedtls( status );
|
||||
mbedtls_fprintf( stderr, "mbedtls_ssl_cipher_to_psa: %d\n", (int)status);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -1496,7 +1495,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
|
||||
PSA_BITS_TO_BYTES( key_bits ),
|
||||
&t_in->psa_key_enc );
|
||||
|
||||
if ( status != PSA_SUCCESS)
|
||||
if ( status != PSA_SUCCESS )
|
||||
{
|
||||
ret = psa_ssl_status_to_mbedtls( status );
|
||||
goto cleanup;
|
||||
@ -1507,7 +1506,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
|
||||
PSA_BITS_TO_BYTES( key_bits ),
|
||||
&t_out->psa_key_enc );
|
||||
|
||||
if ( status != PSA_SUCCESS)
|
||||
if ( status != PSA_SUCCESS )
|
||||
{
|
||||
ret = psa_ssl_status_to_mbedtls( status );
|
||||
goto cleanup;
|
||||
@ -1520,7 +1519,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
|
||||
PSA_BITS_TO_BYTES( key_bits ),
|
||||
&t_in->psa_key_dec );
|
||||
|
||||
if ( status != PSA_SUCCESS)
|
||||
if ( status != PSA_SUCCESS )
|
||||
{
|
||||
ret = psa_ssl_status_to_mbedtls( status );
|
||||
goto cleanup;
|
||||
@ -1531,7 +1530,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in,
|
||||
PSA_BITS_TO_BYTES( key_bits ),
|
||||
&t_out->psa_key_dec );
|
||||
|
||||
if ( status != PSA_SUCCESS)
|
||||
if ( status != PSA_SUCCESS )
|
||||
{
|
||||
ret = psa_ssl_status_to_mbedtls( status );
|
||||
goto cleanup;
|
||||
@ -3307,7 +3306,7 @@ void ssl_crypt_record( int cipher_type, int hash_id,
|
||||
(size_t) cid0_len,
|
||||
(size_t) cid1_len );
|
||||
|
||||
TEST_ASSERT( ret == 0 );
|
||||
TEST_ASSERT( ret == 0 );
|
||||
|
||||
TEST_ASSERT( ( buf = mbedtls_calloc( 1, buflen ) ) != NULL );
|
||||
|
||||
@ -3468,7 +3467,7 @@ void ssl_crypt_record_small( int cipher_type, int hash_id,
|
||||
(size_t) cid0_len,
|
||||
(size_t) cid1_len );
|
||||
|
||||
TEST_ASSERT( ret == 0 );
|
||||
TEST_ASSERT( ret == 0 );
|
||||
|
||||
TEST_ASSERT( ( buf = mbedtls_calloc( 1, buflen ) ) != NULL );
|
||||
|
||||
@ -3720,7 +3719,7 @@ void ssl_decrypt_non_etm_cbc( int cipher_type, int hash_id, int trunc_hmac,
|
||||
* Encrypt and decrypt the correct record, expecting success
|
||||
*/
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
TEST_EQUAL( 0, psa_cipher_encrypt_helper(&t0, t0.iv_enc, t0.ivlen,
|
||||
TEST_EQUAL( 0, psa_cipher_encrypt_helper(&t0, t0.iv_enc, t0.ivlen,
|
||||
rec.buf + rec.data_offset, rec.data_len,
|
||||
rec.buf + rec.data_offset, &olen ) );
|
||||
#else
|
||||
@ -3752,7 +3751,7 @@ void ssl_decrypt_non_etm_cbc( int cipher_type, int hash_id, int trunc_hmac,
|
||||
|
||||
/* Encrypt */
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
TEST_EQUAL( 0, psa_cipher_encrypt_helper(&t0, t0.iv_enc, t0.ivlen,
|
||||
TEST_EQUAL( 0, psa_cipher_encrypt_helper(&t0, t0.iv_enc, t0.ivlen,
|
||||
rec.buf + rec.data_offset, rec.data_len,
|
||||
rec.buf + rec.data_offset, &olen ) );
|
||||
#else
|
||||
@ -3795,7 +3794,7 @@ void ssl_decrypt_non_etm_cbc( int cipher_type, int hash_id, int trunc_hmac,
|
||||
|
||||
/* Encrypt */
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
TEST_EQUAL( 0, psa_cipher_encrypt_helper(&t0, t0.iv_enc, t0.ivlen,
|
||||
TEST_EQUAL( 0, psa_cipher_encrypt_helper(&t0, t0.iv_enc, t0.ivlen,
|
||||
rec.buf + rec.data_offset, rec.data_len,
|
||||
rec.buf + rec.data_offset, &olen ) );
|
||||
#else
|
||||
|
Reference in New Issue
Block a user