Test: Bug fix for PSA ARCH FF test

Signed-off-by: Summer Qin <summer.qin@arm.com>
Change-Id: I9e0a5db679b7ac126094edc3e097312b05b466a0
diff --git a/lib/ext/psa_arch_tests/0001-Init-non-volatile-memory-before-using-in-an521-dev-a.patch b/lib/ext/psa_arch_tests/0001-Init-non-volatile-memory-before-using-in-an521-dev-a.patch
index a304f3d..ef08482 100644
--- a/lib/ext/psa_arch_tests/0001-Init-non-volatile-memory-before-using-in-an521-dev-a.patch
+++ b/lib/ext/psa_arch_tests/0001-Init-non-volatile-memory-before-using-in-an521-dev-a.patch
@@ -1,7 +1,7 @@
-From 028387d49761c20dbbbf36fd6e624774a67ca5e5 Mon Sep 17 00:00:00 2001
+From 86f1cd6dc04ed5141b54a0a72f63d209f7a04655 Mon Sep 17 00:00:00 2001
 From: Summer Qin <summer.qin@arm.com>
 Date: Mon, 11 Apr 2022 11:20:35 +0800
-Subject: [PATCH 1/2] Init non-volatile memory before using in an521 dev apis
+Subject: [PATCH 1/3] Init non-volatile memory before using in an521 dev apis
 
 psa arch test read data from non-volatile memory directly
 without initializing it. The data maybe randomly which may
diff --git a/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch b/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch
index 306deac..752fca0 100644
--- a/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch
+++ b/lib/ext/psa_arch_tests/0002-Disable-obsolete-algorithms.patch
@@ -1,7 +1,7 @@
-From 95e75d02190282825be4c5e9e73a8c4cc71bb042 Mon Sep 17 00:00:00 2001
+From 534d847765c669f307c93b03384bad7e1cb919b3 Mon Sep 17 00:00:00 2001
 From: Summer Qin <summer.qin@arm.com>
 Date: Fri, 10 Jun 2022 10:13:43 +0800
-Subject: [PATCH 2/2] Disable obsolete algorithms
+Subject: [PATCH 2/3] Disable obsolete algorithms
 
 curves of size <255 are obsolete algorithms, should be disabled.
 
diff --git a/lib/ext/psa_arch_tests/0003-Fix-2-issues-in-FF-test.patch b/lib/ext/psa_arch_tests/0003-Fix-2-issues-in-FF-test.patch
new file mode 100644
index 0000000..fd2e472
--- /dev/null
+++ b/lib/ext/psa_arch_tests/0003-Fix-2-issues-in-FF-test.patch
@@ -0,0 +1,102 @@
+From d205709b36671c774b996de1dab815108dc74f8f Mon Sep 17 00:00:00 2001
+From: Summer Qin <summer.qin@arm.com>
+Date: Fri, 17 Jun 2022 15:42:55 +0800
+Subject: [PATCH 3/3] Fix 2 issues in FF test
+
+- Disable secure test when testing version policy. Otherwise, the
+received signal is not matched.
+- In test 27, set wrong parameter and let SPM return expected
+PSA_ERROR_PROGRAMMER_ERROR, instead of making test to directly
+return the error code.
+
+Signed-off-by: Summer Qin <summer.qin@arm.com>
+---
+ api-tests/ff/ipc/test_i005/test_entry_i005.c | 2 +-
+ api-tests/ff/ipc/test_i006/test_entry_i006.c | 2 +-
+ api-tests/ff/ipc/test_i007/test_entry_i007.c | 2 +-
+ api-tests/ff/ipc/test_i010/test_entry_i010.c | 2 +-
+ api-tests/ff/ipc/test_i011/test_entry_i011.c | 2 +-
+ api-tests/ff/ipc/test_i027/test_i027.c       | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/api-tests/ff/ipc/test_i005/test_entry_i005.c b/api-tests/ff/ipc/test_i005/test_entry_i005.c
+index 099d590..78c0ad5 100644
+--- a/api-tests/ff/ipc/test_i005/test_entry_i005.c
++++ b/api-tests/ff/ipc/test_i005/test_entry_i005.c
+@@ -40,7 +40,7 @@ void test_entry(val_api_t *val_api, psa_api_t *psa_api)
+     }
+ 
+     /* Execute list of tests available in test[num]_client_tests_list from Non-secure side*/
+-    status = val->execute_non_secure_tests(TEST_NUM, test_i005_client_tests_list, TRUE);
++    status = val->execute_non_secure_tests(TEST_NUM, test_i005_client_tests_list, FALSE);
+     if (VAL_ERROR(status))
+     {
+         goto test_exit;
+diff --git a/api-tests/ff/ipc/test_i006/test_entry_i006.c b/api-tests/ff/ipc/test_i006/test_entry_i006.c
+index 13f0b7d..c9b2996 100644
+--- a/api-tests/ff/ipc/test_i006/test_entry_i006.c
++++ b/api-tests/ff/ipc/test_i006/test_entry_i006.c
+@@ -40,7 +40,7 @@ void test_entry(val_api_t *val_api, psa_api_t *psa_api)
+     }
+ 
+     /* Execute list of tests available in test[num]_client_tests_list from Non-secure side*/
+-    status = val->execute_non_secure_tests(TEST_NUM, test_i006_client_tests_list, TRUE);
++    status = val->execute_non_secure_tests(TEST_NUM, test_i006_client_tests_list, FALSE);
+     if (VAL_ERROR(status))
+     {
+         goto test_exit;
+diff --git a/api-tests/ff/ipc/test_i007/test_entry_i007.c b/api-tests/ff/ipc/test_i007/test_entry_i007.c
+index 86ea352..e133488 100644
+--- a/api-tests/ff/ipc/test_i007/test_entry_i007.c
++++ b/api-tests/ff/ipc/test_i007/test_entry_i007.c
+@@ -40,7 +40,7 @@ void test_entry(val_api_t *val_api, psa_api_t *psa_api)
+     }
+ 
+     /* Execute list of tests available in test[num]_client_tests_list from Non-secure side*/
+-    status = val->execute_non_secure_tests(TEST_NUM, test_i007_client_tests_list, TRUE);
++    status = val->execute_non_secure_tests(TEST_NUM, test_i007_client_tests_list, FALSE);
+     if (VAL_ERROR(status))
+     {
+         goto test_exit;
+diff --git a/api-tests/ff/ipc/test_i010/test_entry_i010.c b/api-tests/ff/ipc/test_i010/test_entry_i010.c
+index e0e72ef..7d30848 100644
+--- a/api-tests/ff/ipc/test_i010/test_entry_i010.c
++++ b/api-tests/ff/ipc/test_i010/test_entry_i010.c
+@@ -40,7 +40,7 @@ void test_entry(val_api_t *val_api, psa_api_t *psa_api)
+     }
+ 
+     /* Execute list of tests available in test[num]_client_tests_list from Non-secure side*/
+-    status = val->execute_non_secure_tests(TEST_NUM, test_i010_client_tests_list, TRUE);
++    status = val->execute_non_secure_tests(TEST_NUM, test_i010_client_tests_list, FALSE);
+     if (VAL_ERROR(status))
+     {
+         goto test_exit;
+diff --git a/api-tests/ff/ipc/test_i011/test_entry_i011.c b/api-tests/ff/ipc/test_i011/test_entry_i011.c
+index a1ca9c7..c694c8f 100644
+--- a/api-tests/ff/ipc/test_i011/test_entry_i011.c
++++ b/api-tests/ff/ipc/test_i011/test_entry_i011.c
+@@ -40,7 +40,7 @@ void test_entry(val_api_t *val_api, psa_api_t *psa_api)
+     }
+ 
+     /* Execute list of tests available in test[num]_client_tests_list from Non-secure side*/
+-    status = val->execute_non_secure_tests(TEST_NUM, test_i011_client_tests_list, TRUE);
++    status = val->execute_non_secure_tests(TEST_NUM, test_i011_client_tests_list, FALSE);
+     if (VAL_ERROR(status))
+     {
+         goto test_exit;
+diff --git a/api-tests/ff/ipc/test_i027/test_i027.c b/api-tests/ff/ipc/test_i027/test_i027.c
+index 9b74a58..93c766c 100644
+--- a/api-tests/ff/ipc/test_i027/test_i027.c
++++ b/api-tests/ff/ipc/test_i027/test_i027.c
+@@ -78,7 +78,7 @@ int32_t client_test_psa_drop_connection(caller_security_t caller)
+        return VAL_STATUS_ERROR;
+    }
+ 
+-   status_of_call =  psa->call(handle, PSA_IPC_CALL, NULL, 0, NULL, 0);
++   status_of_call =  psa->call(handle, PSA_IPC_CALL, NULL, PSA_MAX_IOVEC, NULL, PSA_MAX_IOVEC);
+ 
+    /*
+     * If the caller is in the NSPE, it is IMPLEMENTATION DEFINED whether
+-- 
+2.17.1
+