Skip to content

Commit 3e6af80

Browse files
committed
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 <[email protected]>
1 parent 6b5d9a3 commit 3e6af80

File tree

5 files changed

+5
-16
lines changed

5 files changed

+5
-16
lines changed

Android.mk

+1-4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ srcs += adbg/src/adbg_case.c \
5353
regression_8000.c \
5454
regression_8100.c \
5555
hash_perf.c \
56+
install_ta.c \
5657
stats.c \
5758
symm_cipher_perf.c \
5859
xtest_helpers.c \
@@ -64,10 +65,6 @@ ifeq ($(CFG_SECURE_PARTITION)-$(CFG_SPMC_TESTS),y-y)
6465
srcs += ffa_spmc_1000.c
6566
endif
6667

67-
ifeq ($(CFG_SECSTOR_TA_MGMT_PTA),y)
68-
srcs += install_ta.c
69-
endif
70-
7168
ifeq ($(CFG_SECURE_DATA_PATH),y)
7269
srcs += sdp_basic.c
7370
endif

host/xtest/CMakeLists.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ set (SRC
5757
regression_8000.c
5858
regression_8100.c
5959
hash_perf.c
60+
install_ta.c
6061
stats.c
6162
symm_cipher_perf.c
6263
xtest_helpers.c
@@ -101,10 +102,6 @@ if (CFG_GP_SOCKETS)
101102
)
102103
endif()
103104

104-
if (CFG_SECSTOR_TA_MGMT_PTA)
105-
list (APPEND SRC install_ta.c)
106-
endif()
107-
108105
if (CFG_SECURE_DATA_PATH)
109106
list (APPEND SRC sdp_basic.c)
110107
endif()

host/xtest/Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ srcs += adbg/src/adbg_case.c \
7272
regression_8000.c \
7373
regression_8100.c \
7474
hash_perf.c \
75+
install_ta.c \
7576
stats.c \
7677
symm_cipher_perf.c \
7778
xtest_helpers.c \
@@ -83,10 +84,6 @@ ifeq ($(CFG_SECURE_PARTITION)-$(CFG_SPMC_TESTS),y-y)
8384
srcs += ffa_spmc_1000.c
8485
endif
8586

86-
ifeq ($(CFG_SECSTOR_TA_MGMT_PTA),y)
87-
srcs += install_ta.c
88-
endif
89-
9087
ifeq ($(CFG_SECURE_DATA_PATH),y)
9188
srcs += sdp_basic.c
9289
endif

host/xtest/install_ta.c

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ int install_ta_runner_cmd_parser(int argc, char *argv[])
126126

127127
res = TEEC_OpenSession(&ctx, &sess, &uuid, TEEC_LOGIN_PUBLIC, NULL,
128128
NULL, &err_origin);
129+
if (res == TEEC_ERROR_ITEM_NOT_FOUND && err_origin == TEEC_ORIGIN_TEE)
130+
errx(1, "TA install is not supported by OP-TEE");
129131
if (res)
130132
errx(1, "TEEC_OpenSession: res %#" PRIx32 " err_orig %#" PRIx32,
131133
res, err_origin);

host/xtest/xtest_main.c

-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,8 @@ void usage(char *program)
104104
printf("\t--hash-perf [opts] Hash performance testing tool (-h for usage)\n");
105105
printf("\t--aes-perf [opts] AES performance testing tool (-h for usage)\n");
106106
printf("\t--asym-perf [opts] Asym performance testing tool (-h for usage)\n");
107-
#ifdef CFG_SECSTOR_TA_MGMT_PTA
108107
printf("\t--install-ta [directory or list of TAs]\n");
109108
printf("\t Install TAs\n");
110-
#endif
111109
#ifdef CFG_SECURE_DATA_PATH
112110
printf("\t--sdp-basic [opts] Basic Secure Data Path test setup ('-h' for usage)\n");
113111
#endif
@@ -172,10 +170,8 @@ int main(int argc, char *argv[])
172170
return aes_perf_runner_cmd_parser(argc-1, &argv[1]);
173171
else if (argc > 1 && !strcmp(argv[1], "--asym-perf"))
174172
return asym_perf_runner_cmd_parser(argc-1, &argv[1]);
175-
#ifdef CFG_SECSTOR_TA_MGMT_PTA
176173
else if (argc > 1 && !strcmp(argv[1], "--install-ta"))
177174
return install_ta_runner_cmd_parser(argc - 1, argv + 1);
178-
#endif
179175
#ifdef CFG_SECURE_DATA_PATH
180176
else if (argc > 1 && !strcmp(argv[1], "--sdp-basic"))
181177
return sdp_basic_runner_cmd_parser(argc-1, &argv[1]);

0 commit comments

Comments
 (0)