summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2022-12-02 20:56:49 +0100
committerJérôme Forissier <jerome@forissier.org>2022-12-07 14:57:34 +0100
commitc44350d720cbec1c9eb29ba983f7b81b810297bc (patch)
tree71e9d74d8d87fd29df1675716c88f07adaabe836
parentd09b2ea799c7e8c7a843d5e3b59854be364087f5 (diff)
regression 4012-4016: remove CFG_SYSTEM_PTA dependency
The regression cases 4012-4016 indicates an unnecessary build-time dependency on CFG_SYSTEM_PTA. So remove the ifdef. The affected test cases (4012 and 4013) instead skip these tests if it turns out that the system PTA isn't available. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--host/xtest/regression_4000.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/host/xtest/regression_4000.c b/host/xtest/regression_4000.c
index 542f569..c38123e 100644
--- a/host/xtest/regression_4000.c
+++ b/host/xtest/regression_4000.c
@@ -5261,9 +5261,9 @@ out:
ADBG_CASE_DEFINE(regression, 4011, xtest_tee_test_4011,
"Test TEE Internal API Bleichenbacher attack (negative)");
-#ifdef CFG_SYSTEM_PTA
static void xtest_tee_test_4012(ADBG_Case_t *c)
{
+ TEEC_Result res = TEEC_SUCCESS;
TEEC_Session session = { };
uint32_t ret_orig = 0;
TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
@@ -5291,11 +5291,15 @@ static void xtest_tee_test_4012(ADBG_Case_t *c)
&ret_orig)))
return;
- (void)ADBG_EXPECT_TEEC_SUCCESS(c,
- TEEC_InvokeCommand(&session,
- TA_CRYPT_CMD_SEED_RNG_POOL,
- &op,
- &ret_orig));
+ res = TEEC_InvokeCommand(&session, TA_CRYPT_CMD_SEED_RNG_POOL,
+ &op, &ret_orig);
+ if (res == TEEC_ERROR_ITEM_NOT_FOUND &&
+ ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, ret_orig,
+ TEEC_ORIGIN_TRUSTED_APP))
+ Do_ADBG_Log("System PTA not available, skipping test 4012");
+ else
+ ADBG_EXPECT_TEEC_SUCCESS(c, res);
+
TEEC_CloseSession(&session);
}
ADBG_CASE_DEFINE(regression, 4012, xtest_tee_test_4012,
@@ -5303,6 +5307,7 @@ ADBG_CASE_DEFINE(regression, 4012, xtest_tee_test_4012,
static void xtest_tee_test_4013(ADBG_Case_t *c)
{
+ TEEC_Result res = TEEC_SUCCESS;
TEEC_Session session = { };
uint32_t ret_orig = 0;
TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
@@ -5318,11 +5323,15 @@ static void xtest_tee_test_4013(ADBG_Case_t *c)
NULL, &ret_orig)))
return;
- (void)ADBG_EXPECT_TEEC_SUCCESS(c,
- TEEC_InvokeCommand(&session,
- TA_CRYPT_CMD_DERIVE_TA_UNIQUE_KEY,
- &op,
- &ret_orig));
+ res = TEEC_InvokeCommand(&session, TA_CRYPT_CMD_DERIVE_TA_UNIQUE_KEY,
+ &op, &ret_orig);
+ if (res == TEEC_ERROR_ITEM_NOT_FOUND &&
+ ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, ret_orig,
+ TEEC_ORIGIN_TRUSTED_APP)) {
+ Do_ADBG_Log("System PTA not available, skipping test 4013");
+ goto out;
+ }
+ ADBG_EXPECT_TEEC_SUCCESS(c, res);
/* Negative test using non-secure memory */
memset(&op, 0, sizeof(op));
@@ -5342,6 +5351,7 @@ static void xtest_tee_test_4013(ADBG_Case_t *c)
&op,
&ret_orig));
+out:
TEEC_CloseSession(&session);
}
ADBG_CASE_DEFINE(regression, 4013, xtest_tee_test_4013,
@@ -5985,5 +5995,3 @@ out:
}
ADBG_CASE_DEFINE(regression, 4016, xtest_tee_test_4016_ed25519,
"Test TEE Internal API ED25519 sign/verify");
-
-#endif /*CFG_SYSTEM_PTA*/