diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 154d4150a..4c08a9017 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -9685,23 +9685,26 @@ void generate_key_rsa(int bits_arg, } /* Test the key information */ -#if (defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR_IMPORT) && \ - defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR_EXPORT)) || \ - defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_PUBLIC_KEY) PSA_ASSERT(psa_get_key_attributes(key, &attributes)); TEST_EQUAL(psa_get_key_type(&attributes), type); TEST_EQUAL(psa_get_key_bits(&attributes), bits); - PSA_ASSERT(psa_get_key_domain_parameters(&attributes, - e_read_buffer, e_read_size, - &e_read_length)); + psa_status_t status = psa_get_key_domain_parameters(&attributes, + e_read_buffer, e_read_size, + &e_read_length); + + +#if (defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR_IMPORT) && \ + defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR_EXPORT)) || \ + defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_PUBLIC_KEY) if (is_default_public_exponent) { TEST_EQUAL(e_read_length, 0); } else { + TEST_EQUAL(status, PSA_SUCCESS); TEST_MEMORY_COMPARE(e_read_buffer, e_read_length, e_arg->x, e_arg->len); } #else - (void) e_read_length; (void) is_default_public_exponent; + TEST_EQUAL(status, PSA_ERROR_NOT_SUPPORTED); #endif /* Do something with the key according to its type and permitted usage. */