Add missing test skip for ALT-implemented GCM

Bypass was applied to aead_encrypt and aead_decrypt cases, but not
aead_encrypt_decrypt.

Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
Steven Cooreman 2021-02-15 15:19:25 +01:00
parent 5cd00d28bf
commit f49478b1ff

View File

@ -3874,6 +3874,7 @@ void aead_encrypt_decrypt( int key_type_arg, data_t *key_data,
unsigned char *output_data2 = NULL; unsigned char *output_data2 = NULL;
size_t output_length2 = 0; size_t output_length2 = 0;
size_t tag_length = PSA_AEAD_TAG_LENGTH( alg ); size_t tag_length = PSA_AEAD_TAG_LENGTH( alg );
psa_status_t status = PSA_ERROR_GENERIC_ERROR;
psa_status_t expected_result = expected_result_arg; psa_status_t expected_result = expected_result_arg;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
@ -3894,14 +3895,24 @@ void aead_encrypt_decrypt( int key_type_arg, data_t *key_data,
PSA_ASSERT( psa_import_key( &attributes, key_data->x, key_data->len, PSA_ASSERT( psa_import_key( &attributes, key_data->x, key_data->len,
&key ) ); &key ) );
TEST_EQUAL( psa_aead_encrypt( key, alg, status = psa_aead_encrypt( key, alg,
nonce->x, nonce->len, nonce->x, nonce->len,
additional_data->x, additional_data->x,
additional_data->len, additional_data->len,
input_data->x, input_data->len, input_data->x, input_data->len,
output_data, output_size, output_data, output_size,
&output_length ), &output_length );
expected_result );
/* If the operation is not supported, just skip and not fail in case the
* encryption involves a common limitation of cryptography hardwares and
* an alternative implementation. */
if( status == PSA_ERROR_NOT_SUPPORTED )
{
MBEDTLS_TEST_PSA_SKIP_IF_ALT_AES_192( key_type, key_data->len * 8 );
MBEDTLS_TEST_PSA_SKIP_IF_ALT_GCM_NOT_12BYTES_NONCE( alg, nonce->len );
}
TEST_EQUAL( status, expected_result );
if( PSA_SUCCESS == expected_result ) if( PSA_SUCCESS == expected_result )
{ {