mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-03 08:50:58 +00:00
Fix usage of TEST_ASSERT
Add missing == PSA_SUCCESS in TEST_ASSERT usage
This commit is contained in:
parent
4f5eb7cb54
commit
091e73b22b
|
@ -591,7 +591,7 @@ void aead_encrypt_decrypt( int key_type_arg, char *key_hex,
|
||||||
unsigned char *output_data2 = NULL;
|
unsigned char *output_data2 = NULL;
|
||||||
size_t output_length2;
|
size_t output_length2;
|
||||||
psa_status_t actual_status;
|
psa_status_t actual_status;
|
||||||
uint8_t* nonce = NULL;
|
uint8_t nonce[16];
|
||||||
size_t nonce_length = 16;
|
size_t nonce_length = 16;
|
||||||
size_t tag_length = 16;
|
size_t tag_length = 16;
|
||||||
|
|
||||||
|
@ -606,8 +606,7 @@ void aead_encrypt_decrypt( int key_type_arg, char *key_hex,
|
||||||
{
|
{
|
||||||
nonce_length = 12;
|
nonce_length = 12;
|
||||||
}
|
}
|
||||||
nonce = mbedtls_calloc( 1, nonce_length );
|
|
||||||
TEST_ASSERT( nonce != NULL );
|
|
||||||
for( int i = 0; i < nonce_length; ++nonce_length )
|
for( int i = 0; i < nonce_length; ++nonce_length )
|
||||||
nonce[i] = i;
|
nonce[i] = i;
|
||||||
|
|
||||||
|
@ -620,7 +619,7 @@ void aead_encrypt_decrypt( int key_type_arg, char *key_hex,
|
||||||
nonce, nonce_length,
|
nonce, nonce_length,
|
||||||
additional_data, additional_data_length,
|
additional_data, additional_data_length,
|
||||||
input_data, input_size, output_data,
|
input_data, input_size, output_data,
|
||||||
input_size, &output_length ) );
|
input_size, &output_length ) == PSA_SUCCESS );
|
||||||
|
|
||||||
output_data2 = mbedtls_calloc( 1, output_length );
|
output_data2 = mbedtls_calloc( 1, output_length );
|
||||||
TEST_ASSERT( output_data2 != NULL );
|
TEST_ASSERT( output_data2 != NULL );
|
||||||
|
@ -629,7 +628,7 @@ void aead_encrypt_decrypt( int key_type_arg, char *key_hex,
|
||||||
nonce, nonce_length,
|
nonce, nonce_length,
|
||||||
additional_data, additional_data_length,
|
additional_data, additional_data_length,
|
||||||
output_data, output_length - tag_length, output_data2,
|
output_data, output_length - tag_length, output_data2,
|
||||||
output_length, &output_length2 ) );
|
output_length, &output_length2 ) == PSA_SUCCESS );
|
||||||
|
|
||||||
TEST_ASSERT( memcmp( input, output_data2,
|
TEST_ASSERT( memcmp( input, output_data2,
|
||||||
input_size ) == 0 );
|
input_size ) == 0 );
|
||||||
|
|
Loading…
Reference in a new issue