xtest: remove CFG_SECSTOR_TA_MGMT_PTA dependency
Makes xtest tool more flexible regarding OP-TEE configuration
of CFG_SECSTOR_TA_MGMT_PTA.
Embed TA install interface in xtest even if devkit configuration
says the secure storage TA management PTA service is not available.
If the service is not found (secstor TA management PTA) print an
explicit error message instead.
This change does not change xtest regression suite behavior and will
still fails if one uses --install-ta option when the effective embedded
TEE does not provide this service. This change adds an explicit error
message when so.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/Android.mk b/Android.mk
index 79cb326..556b945 100644
--- a/Android.mk
+++ b/Android.mk
@@ -53,6 +53,7 @@
regression_8000.c \
regression_8100.c \
hash_perf.c \
+ install_ta.c \
stats.c \
symm_cipher_perf.c \
xtest_helpers.c \
@@ -64,10 +65,6 @@
srcs += ffa_spmc_1000.c
endif
-ifeq ($(CFG_SECSTOR_TA_MGMT_PTA),y)
-srcs += install_ta.c
-endif
-
ifeq ($(CFG_SECURE_DATA_PATH),y)
srcs += sdp_basic.c
endif
diff --git a/host/xtest/CMakeLists.txt b/host/xtest/CMakeLists.txt
index 5f42b01..da193bd 100644
--- a/host/xtest/CMakeLists.txt
+++ b/host/xtest/CMakeLists.txt
@@ -57,6 +57,7 @@
regression_8000.c
regression_8100.c
hash_perf.c
+ install_ta.c
stats.c
symm_cipher_perf.c
xtest_helpers.c
@@ -101,10 +102,6 @@
)
endif()
-if (CFG_SECSTOR_TA_MGMT_PTA)
- list (APPEND SRC install_ta.c)
-endif()
-
if (CFG_SECURE_DATA_PATH)
list (APPEND SRC sdp_basic.c)
endif()
diff --git a/host/xtest/Makefile b/host/xtest/Makefile
index 5959ed6..2bdf759 100644
--- a/host/xtest/Makefile
+++ b/host/xtest/Makefile
@@ -72,6 +72,7 @@
regression_8000.c \
regression_8100.c \
hash_perf.c \
+ install_ta.c \
stats.c \
symm_cipher_perf.c \
xtest_helpers.c \
@@ -83,10 +84,6 @@
srcs += ffa_spmc_1000.c
endif
-ifeq ($(CFG_SECSTOR_TA_MGMT_PTA),y)
-srcs += install_ta.c
-endif
-
ifeq ($(CFG_SECURE_DATA_PATH),y)
srcs += sdp_basic.c
endif
diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
index 431981d..edcd9ff 100644
--- a/host/xtest/install_ta.c
+++ b/host/xtest/install_ta.c
@@ -126,6 +126,8 @@
res = TEEC_OpenSession(&ctx, &sess, &uuid, TEEC_LOGIN_PUBLIC, NULL,
NULL, &err_origin);
+ if (res == TEEC_ERROR_ITEM_NOT_FOUND && err_origin == TEEC_ORIGIN_TEE)
+ errx(1, "TA install is not supported by OP-TEE");
if (res)
errx(1, "TEEC_OpenSession: res %#" PRIx32 " err_orig %#" PRIx32,
res, err_origin);
diff --git a/host/xtest/xtest_main.c b/host/xtest/xtest_main.c
index 62aef61..e375dff 100644
--- a/host/xtest/xtest_main.c
+++ b/host/xtest/xtest_main.c
@@ -104,10 +104,8 @@
printf("\t--hash-perf [opts] Hash performance testing tool (-h for usage)\n");
printf("\t--aes-perf [opts] AES performance testing tool (-h for usage)\n");
printf("\t--asym-perf [opts] Asym performance testing tool (-h for usage)\n");
-#ifdef CFG_SECSTOR_TA_MGMT_PTA
printf("\t--install-ta [directory or list of TAs]\n");
printf("\t Install TAs\n");
-#endif
#ifdef CFG_SECURE_DATA_PATH
printf("\t--sdp-basic [opts] Basic Secure Data Path test setup ('-h' for usage)\n");
#endif
@@ -172,10 +170,8 @@
return aes_perf_runner_cmd_parser(argc-1, &argv[1]);
else if (argc > 1 && !strcmp(argv[1], "--asym-perf"))
return asym_perf_runner_cmd_parser(argc-1, &argv[1]);
-#ifdef CFG_SECSTOR_TA_MGMT_PTA
else if (argc > 1 && !strcmp(argv[1], "--install-ta"))
return install_ta_runner_cmd_parser(argc - 1, argv + 1);
-#endif
#ifdef CFG_SECURE_DATA_PATH
else if (argc > 1 && !strcmp(argv[1], "--sdp-basic"))
return sdp_basic_runner_cmd_parser(argc-1, &argv[1]);