Skip to content

Commit 9811147

Browse files
author
Hernan Gatta
committed
xtest: regression 1100: add OCALL tests
Add 10 tests that check the behaviour of the OCALL functionality. The tests in question are detailed below: OCALL without parameters: ------------------------- Performs an OCALL without any parameters. OCALL with value parameters (in/inout/out/in): ---------------------------------------------- Performs an OCALL with value parameters and in parameter directions, verifying that the values are transferred correctly between normal world and secure world. OCALL with memref parameters (in/inout/out/in): ----------------------------------------------- Performs an OCALL with memref parameters and in parameter directions, verifying that the bufers are transferred correctly between normal world and secure world. Close session during OCALL: --------------------------- Performs an OCALL that closes the session through which the original function invocation was performed. Ascertains that the OCALL is cancelled and that the session is closed. Finalize context during OCALL: ------------------------------ Performs an OCALL that finalizes the context through which the original function invocation was performed. Ascertains that the OCALL is cancelled and that the session that was originally used to perform the function invocation is closed as a result of the context being finalized. NULL memref param: ------------------ Verifies that OCALLs can carry memref parameters with NULL buffers in all directions. NULL memref param (mixed params): --------------------------------- Verifies that OCALLs can carry memref parameters with NULL buffers alongside value and non-NULL memref parameters in various directions. NULL memref param (invalid params): ----------------------------------- Verifies that attempting to perform an OCALL with memref parameters with a NULL buffer and a non-zero size and with a non-NULL buffer and a zero size fails at the Internal Core API layer. OCALL during session open: -------------------------- Ascertains that the CA can receive an OCALL during session open. Finalize context during session open OCALL: ------------------------------------------- Performs an OCALL during session open that finalizes the context via which the session was being opened, verifies that the OCALL is cancelled, and that the session fails to open. Signed-off-by: Hernan Gatta <hegatta@microsoft.com>
1 parent 3ef6bf9 commit 9811147

16 files changed

Lines changed: 1237 additions & 2 deletions

Android.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH)/host/xtest \
105105
$(LOCAL_PATH)/ta/aes_perf/include \
106106
$(LOCAL_PATH)/ta/socket/include \
107107
$(LOCAL_PATH)/ta/sdp_basic/include \
108-
$(LOCAL_PATH)/ta/tpm_log_test/include
108+
$(LOCAL_PATH)/ta/tpm_log_test/include \
109+
$(LOCAL_PATH)/ta/ocall/include
109110

110111
# Include configuration file generated by OP-TEE OS (CFG_* macros)
111112
LOCAL_CFLAGS += -I $(TA_DEV_KIT_DIR)/host_include -include conf.h

host/xtest/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ if (CFG_PKCS11_TA)
8686
list (APPEND SRC pkcs11_1000.c)
8787
endif()
8888

89+
if (CFG_OCALL)
90+
list (APPEND SRC regression_1100.c)
91+
endif()
92+
8993
################################################################################
9094
# Built binary
9195
################################################################################

host/xtest/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ endif #OPTEE_OPENSSL_EXPORT
5454
endif #require OpenSSL
5555

5656
srcs := regression_1000.c
57+
srcs := regression_1100.c
5758

5859
ifeq ($(CFG_GP_SOCKETS),y)
5960
srcs += regression_2000.c \
@@ -111,6 +112,10 @@ srcs += gp_7000.c \
111112
gp_9000.c
112113
endif
113114

115+
ifeq ($(CFG_OCALL),y)
116+
srcs += regression_1100.c
117+
endif
118+
114119
objs := $(patsubst %.c,$(out-dir)/xtest/%.o, $(srcs))
115120

116121
CFLAGS += -I./
@@ -138,6 +143,7 @@ CFLAGS += -I../../ta/aes_perf/include
138143
CFLAGS += -I../../ta/socket/include
139144
CFLAGS += -I../../ta/sdp_basic/include
140145
CFLAGS += -I../../ta/tpm_log_test/include
146+
CFLAGS += -I../../ta/ocall/include
141147

142148
ifdef CFG_GP_PACKAGE_PATH
143149
CFLAGS += -I../../ta/GP_TTA_Arithmetical

0 commit comments

Comments
 (0)