Test PSA functions against PSA_SUCCESS, not 0

Writing 0 instead of PSA_SUCCESS is correct, but bad form.
This commit is contained in:
Gilles Peskine 2019-06-07 15:39:07 +02:00
parent 69c0ea26c7
commit 614faa26ac
2 changed files with 3 additions and 3 deletions

View file

@ -982,7 +982,7 @@ void auth_crypt_tv( int cipher_id, data_t * key, data_t * iv,
#else
if( use_psa == 1 )
{
TEST_ASSERT( psa_crypto_init() == 0 );
TEST_ASSERT( psa_crypto_init( ) == PSA_SUCCESS );
/* PSA requires that the tag immediately follows the ciphertext. */
tmp_cipher = mbedtls_calloc( 1, cipher->len + tag->len );
@ -1143,7 +1143,7 @@ void test_vec_crypt( int cipher_id, int operation, char *hex_key,
#else
if( use_psa == 1 )
{
TEST_ASSERT( psa_crypto_init() == 0 );
TEST_ASSERT( psa_crypto_init( ) == PSA_SUCCESS );
TEST_ASSERT( 0 == mbedtls_cipher_setup_psa( &ctx,
mbedtls_cipher_info_from_type( cipher_id ), 0 ) );
}

View file

@ -127,7 +127,7 @@ void pk_psa_utils( )
mbedtls_pk_init( &pk );
mbedtls_pk_init( &pk2 );
TEST_ASSERT( psa_crypto_init() == 0 );
TEST_ASSERT( psa_crypto_init( ) == PSA_SUCCESS );
TEST_ASSERT( mbedtls_pk_setup_opaque( &pk, 0 ) ==
MBEDTLS_ERR_PK_BAD_INPUT_DATA );