tests_psa_arch: Accommodate dual return values on crypto test 41
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: Id80ccc2d10fc0361377308414b26c29b1b5d95ba
diff --git a/tests_psa_arch/fetch_repo/0010-Add-multiple-expected-return-statuses-in-case-of-inv.patch b/tests_psa_arch/fetch_repo/0010-Add-multiple-expected-return-statuses-in-case-of-inv.patch
new file mode 100644
index 0000000..2a0a80a
--- /dev/null
+++ b/tests_psa_arch/fetch_repo/0010-Add-multiple-expected-return-statuses-in-case-of-inv.patch
@@ -0,0 +1,128 @@
+From e0210ad8109519e77785a2d1170d6b37e0e8ba3a Mon Sep 17 00:00:00 2001
+From: Waleed Elmelegy <waleed.elmelegy@arm.com>
+Date: Wed, 26 Mar 2025 15:53:13 +0000
+Subject: [PATCH] Add multiple expected return statuses in case of invalid
+ algorithm
+
+Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
+---
+ .../dev_apis/crypto/test_c041/test_c041.c | 7 +++++--
+ .../dev_apis/crypto/test_c041/test_data.h | 20 +++++++++----------
+ 2 files changed, 15 insertions(+), 12 deletions(-)
+
+diff --git a/api-tests/dev_apis/crypto/test_c041/test_c041.c b/api-tests/dev_apis/crypto/test_c041/test_c041.c
+index 0fe0ef5..0fceaba 100644
+--- a/api-tests/dev_apis/crypto/test_c041/test_c041.c
++++ b/api-tests/dev_apis/crypto/test_c041/test_c041.c
+@@ -77,9 +77,12 @@ int32_t psa_sign_hash_test(caller_security_t caller __UNUSED)
+ check1[i].signature,
+ check1[i].signature_size,
+ &get_signature_length);
+- TEST_ASSERT_EQUAL(status, check1[i].expected_status, TEST_CHECKPOINT_NUM(4));
++ TEST_ASSERT_DUAL(status,
++ check1[i].expected_status[0],
++ check1[i].expected_status[1],
++ TEST_CHECKPOINT_NUM(4));
+
+- if (check1[i].expected_status != PSA_SUCCESS)
++ if (check1[i].expected_status[0] != PSA_SUCCESS)
+ {
+ /* Destroy the key */
+ status = val->crypto_function(VAL_CRYPTO_DESTROY_KEY, key);
+diff --git a/api-tests/dev_apis/crypto/test_c041/test_data.h b/api-tests/dev_apis/crypto/test_c041/test_data.h
+index a7ae40f..ab63deb 100644
+--- a/api-tests/dev_apis/crypto/test_c041/test_data.h
++++ b/api-tests/dev_apis/crypto/test_c041/test_data.h
+@@ -30,7 +30,7 @@ typedef struct {
+ size_t signature_size;
+ const uint8_t *expected_signature;
+ size_t expected_signature_length;
+- psa_status_t expected_status;
++ psa_status_t expected_status[2];
+ } test_data;
+
+ static const test_data check1[] = {
+@@ -49,7 +49,7 @@ static const test_data check1[] = {
+ .signature_size = BUFFER_SIZE,
+ .expected_signature = signature_1,
+ .expected_signature_length = 128,
+- .expected_status = PSA_SUCCESS,
++ .expected_status = {PSA_SUCCESS,PSA_SUCCESS},
+ },
+ #endif
+
+@@ -68,7 +68,7 @@ static const test_data check1[] = {
+ .signature_size = BUFFER_SIZE,
+ .expected_signature = signature_2,
+ .expected_signature_length = 128,
+- .expected_status = PSA_SUCCESS,
++ .expected_status = {PSA_SUCCESS,PSA_SUCCESS},
+ },
+ #endif
+ #endif
+@@ -90,7 +90,7 @@ static const test_data check1[] = {
+ .signature_size = BUFFER_SIZE,
+ .expected_signature = signature_3,
+ .expected_signature_length = 64,
+- .expected_status = PSA_SUCCESS,
++ .expected_status = {PSA_SUCCESS,PSA_SUCCESS},
+ },
+ #endif
+ #endif
+@@ -110,7 +110,7 @@ static const test_data check1[] = {
+ .signature_size = 128,
+ .expected_signature = NULL,
+ .expected_signature_length = 0,
+- .expected_status = PSA_ERROR_INVALID_ARGUMENT,
++ .expected_status = {PSA_ERROR_INVALID_ARGUMENT,PSA_ERROR_INVALID_ARGUMENT},
+ },
+
+ {
+@@ -126,7 +126,7 @@ static const test_data check1[] = {
+ .signature_size = 127,
+ .expected_signature = signature_1,
+ .expected_signature_length = 128,
+- .expected_status = PSA_ERROR_BUFFER_TOO_SMALL,
++ .expected_status = {PSA_ERROR_BUFFER_TOO_SMALL,PSA_ERROR_BUFFER_TOO_SMALL}
+ },
+ #endif
+
+@@ -143,7 +143,7 @@ static const test_data check1[] = {
+ .signature_size = BUFFER_SIZE,
+ .expected_signature = NULL,
+ .expected_signature_length = 0,
+- .expected_status = PSA_ERROR_INVALID_ARGUMENT,
++ .expected_status = {PSA_ERROR_INVALID_ARGUMENT,PSA_ERROR_NOT_SUPPORTED}
+ },
+ #endif
+
+@@ -162,7 +162,7 @@ static const test_data check1[] = {
+ .signature_size = BUFFER_SIZE,
+ .expected_signature = NULL,
+ .expected_signature_length = 0,
+- .expected_status = PSA_ERROR_INVALID_ARGUMENT,
++ .expected_status = {PSA_ERROR_INVALID_ARGUMENT,PSA_ERROR_INVALID_ARGUMENT},
+ },
+ #endif
+ #endif
+@@ -183,7 +183,7 @@ static const test_data check1[] = {
+ .signature_size = BUFFER_SIZE,
+ .expected_signature = NULL,
+ .expected_signature_length = 0,
+- .expected_status = PSA_ERROR_NOT_PERMITTED,
++ .expected_status = {PSA_ERROR_NOT_PERMITTED,PSA_ERROR_NOT_PERMITTED},
+ },
+ #endif
+
+@@ -202,7 +202,7 @@ static const test_data check1[] = {
+ .signature_size = BUFFER_SIZE,
+ .expected_signature = NULL,
+ .expected_signature_length = 0,
+- .expected_status = PSA_ERROR_INVALID_ARGUMENT,
++ .expected_status = {PSA_ERROR_INVALID_ARGUMENT,PSA_ERROR_INVALID_ARGUMENT},
+ },
+ #endif
+ #endif
+--
+2.25.1
+