- Jul 08, 2024
-
-
Add a new variable to have the directory that contains the openssl libraries needed for xtest. The build system will look for the needed libraries specified in this variable during the linking of xtest. Signed-off-by:
Davidson Kumaresan <davidson.kumaresan@arm.com>
-
- Apr 02, 2024
-
-
The OP-TEE client library has been updated to include an 'imp' field as required by the GlobalPlatform specification. Therefore, update the parts of the code that access the TEE context which is now inside this 'imp' struct. This commit is the result of the following commands: sed -i 's/sess->ctx/sess->imp.ctx/' $(git grep -l 'sess->ctx') sed -i 's/s->ctx/s->imp.ctx/' $(git grep -l 's->ctx') Signed-off-by:
Jerome Forissier <jerome.forissier@linaro.org> Acked-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
As the test xtest_tee_test_1025() uses a part of a struct from tee_client_api.h that is implementation defined, the test needed to be updated when the implementation defined parts of the structs in tee_client_api.h changed to use an imp field instead of separate fields. Signed-off-by:
Julianus Larson <julianus.larson@linaro.org> Reported-by:
Tom Hebb <tommyhebb@gmail.com> Reviewed-by:
Jerome Forissier <jerome.forissier@linaro.org> Acked-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
- Feb 28, 2024
-
-
Add perf test for SM4 algorithm Signed-off-by:
Zexi Yu <yuzexi@hisilicon.com> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Feb 23, 2024
-
-
The specification seems to indicate (see https://github.com/OP-TEE/optee_test/issues/731 ) that the cancellation mask is reset at the start of every entry point. As a result, the TEE_UnmakCancellation() should not be called at the end of TA_OpenSessionEntryPoint(), but at the start of TA_InvokeCommandEntryPoint(). Signed-off-by:
Cedric Auger <cedric.auger@provenrun.com> Reviewed-by:
Jerome Forissier <jerome.forissier@linaro.org> Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Feb 22, 2024
-
-
Add pkcs11_1030 test case for CKM_AES_GCM encryption and decryption tests based on AES GCM test vectors from regression_4000_data.h. Each vector is tested with both the one-shot API function C_Encrypt() (resp. C_Decrypt()) and the update/final stepped processing API functions C_EncryptUpdate() and C_EncryptFinal() (resp. C_DecryptUpdate() and C_DecryptFinal()). Each test vector is also tested with modified cipher text and modified authentication for a negative case. Reviewed-by:
Marouene Boubakri <marouene.boubakri@nxp.com> Co-developed-by:
Marouene Boubakri <marouene.boubakri@nxp.com> Signed-off-by:
Marouene Boubakri <marouene.boubakri@nxp.com> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Extends Test 1005 to include checks for AES-GCM with both valid and invalid modes. Signed-off-by:
Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Extends Test 1005 to include checks for AES-GCM flag with both valid and invalid uage. Signed-off-by:
Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Feb 21, 2024
-
-
Fix a minor indentation issue in asym_test.c. Fixes: bcd55831 ("xtest: add asymmetric cipher perf test") Acked-by:
Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Sort out some coding style issue that are better being fixed for test TAs implementation consistency. No functional changes. Fixes: e18381f5 ("xtest: combine aes_perf and hash_perf TAs into crypto_perf") Acked-by:
Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Sort out some coding style issues that are better being fixed for the consistency of the implementation of the test TAs. No functional changes. Fixes: 14a2b2ac ("ta: crypto_perf: add asymmetric crypto perf tests") Acked-by:
Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Fix build error in crypto_perf TA as shown in below build trace messages when built for a 64bit target: ta_crypto_perf.c: In function 'cmd_asym_process_rsa_ecc': ta_crypto_perf.c:772:33: warning: assignment to 'TEE_Result (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, uint32_t, const void *, uint32_t, void *, uint32_t *)' {aka 'unsigned int (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, unsigned int, const void *, unsigned int, void *, unsigned int *)'} from incompatible pointer type 'TEE_Result (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, uint32_t, const void *, size_t, void *, size_t *)' {aka 'unsigned int (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, unsigned int, const void *, long unsigned int, void *, long unsigned int *)'} [-Wincompatible-pointer-types] 772 | do_asym = TEE_AsymmetricEncrypt; | ^ ta_crypto_perf.c:774:33: warning: assignment to 'TEE_Result (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, uint32_t, const void *, uint32_t, void *, uint32_t *)' {aka 'unsigned int (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, unsigned int, const void *, unsigned int, void *, unsigned int *)'} from incompatible pointer type 'TEE_Result (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, uint32_t, const void *, size_t, void *, size_t *)' {aka 'unsigned int (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, unsigned int, const void *, long unsigned int, void *, long unsigned int *)'} [-Wincompatible-pointer-types] 774 | do_asym = TEE_AsymmetricDecrypt; | ^ ta_crypto_perf.c:776:33: warning: assignment to 'TEE_Result (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, uint32_t, const void *, uint32_t, void *, uint32_t *)' {aka 'unsigned int (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, unsigned int, const void *, unsigned int, void *, unsigned int *)'} from incompatible pointer type 'TEE_Result (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, uint32_t, const void *, size_t, void *, size_t *)' {aka 'unsigned int (*)(struct __TEE_OperationHandle *, const TEE_Attribute *, unsigned int, const void *, long unsigned int, void *, long unsigned int *)'} [-Wincompatible-pointer-types] 776 | do_asym = TEE_AsymmetricSignDigest; | ^ ta_crypto_perf.c:784:64: warning: passing argument 7 of 'do_asym' from incompatible pointer type [-Wincompatible-pointer-types] 784 | params[2].memref.buffer, &dummy_size); | ^~~~~~~~~~~ | | | size_t * {aka long unsigned int *} ta_crypto_perf.c:784:64: note: expected 'uint32_t *' {aka 'unsigned int *'} but argument is of type 'size_t *' {aka 'long unsigned int *'} ta_crypto_perf.c: At top level: Fixes: 14a2b2ac ("ta: crypto_perf: add asymmetric crypto perf tests") Acked-by:
Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Fix build warning in crypto_perf TA as shown in below build trace messages: ta_crypto_perf.c:704:42: warning: unused parameter ‘params’ [-Wunused-parameter] 704 | TEE_Param params[TEE_NUM_PARAMS]) | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ ta_crypto_perf.c: In function ‘cmd_asym_process_keypair’: ta_crypto_perf.c:745:1: warning: label ‘out’ defined but not used [-Wunused-label] 745 | out: | ^~~ ta_crypto_perf.c: In function ‘cmd_asym_process_rsa_ecc’: ta_crypto_perf.c:796:1: warning: label ‘out’ defined but not used [-Wunused-label] 796 | out: | ^~~ Fixes: 14a2b2ac ("ta: crypto_perf: add asymmetric crypto perf tests") Acked-by:
Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Check if the generated private DH key is a CAAM black key. If it is the case, skip the buffer size check as the key size and CAAM black key buffer size do not match. Signed-off-by:
Clement Faure <clement.faure@nxp.com> Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
- Feb 12, 2024
-
-
Remove unneeded files from the root filesystem to avoid a "No space left on device" error. A similar trick was committed to optee_os for the same reason [1]. Link: https://github.com/OP-TEE/optee_os/commit/fa1950059f4128a9b58558d4970c153595463ff3 [1] Signed-off-by:
Jerome Forissier <jerome.forissier@linaro.org> Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Feb 09, 2024
-
-
Add perf test for DH, RSA, ECDH, ECDSA algorithm Signed-off-by:
Zexi Yu <yuzexi@hisilicon.com> Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Add perf test for DH, RSA, ECDH, ECDSA algorithm Signed-off-by:
Zexi Yu <yuzexi@hisilicon.com> Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Feb 05, 2024
-
-
OP-TEE's PKCS#11 TA TEE<->REE interface treats CK_ULONG's as 32 bit. In 64 bit machines this creates a problem for CK_ULONG values that are architecture dependent. One of those defines is CK_UNAVAILABLE_INFORMATION. This adds test case to make sure that when OP-TEE's PKCS#11 TA should give CK_UNAVAILABLE_INFORMATION it actually does that. Signed-off-by:
Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Feb 02, 2024
-
-
Add all counter wrap test vectors from google/wycheproof repo [1] to the xtest regression 4005 test suite. To create a link between xtest and wycheproof test cases, tcId is printed as an extra information in the result log. Link: [1] https://github.com/google/wycheproof/blob/master/testvectors_v1/aes_gcm_test.json Signed-off-by:
Olivier Masse <olivier.masse@nxp.com> Reviewed-by:
Jerome Forissier <jerome.forissier@linaro.org> Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Jan 11, 2024
-
-
This test involves PKCS11_CKA_CHECK_VALUE when enabled, as per the spec, the attribute can be either the legitimate value recomputed by the PKCS#11 token or a zero-sized value called a no-value for when client does not want the attribute to set in an object. This test invokes Cryptoki API functions C_GenerateKey(), C_CreateObject(), C_CopyObject(), C_SetAttributeValue(), C_UnwrapKey() and C_DeriveKey() to perform check value computation and this test query the value using C_GetAttributeValue(). Signed-off-by:
Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Dec 08, 2023
-
-
Add 'xtest --stats' options '--clocks' and '--regulators' to respectively dump OP-TEE core clock tree and regulator tree to the secure console. Reviewed-by:
Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Rely on pta_stats.h header file for the statistics PTA API definition rather than using a local definition. Reviewed-by:
Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Replace printf() occurrences with use of MSG() macro in TA implementation source and header files. MSG() macro already prints the function label and the line number hence remove these explicit arguments from trace messages printed by HALT() macro. Use PRI* specifiers in trace messages using xMSG() macros. Add parentheses to function names in trace message where applicable to explicit these are function labels. Add an empty line in implementation of DEF_BIGINT() macro to comply with OP-TEE coding style. Reviewed-by:
Joakim Bech <joakim.bech@linaro.org> Reviewed-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Use PRI* specifiers in trace messages using xMSG() macros and fix indentation issues. Reviewed-by:
Joakim Bech <joakim.bech@linaro.org> Reviewed-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Use PRI* specifiers in trace messages using xMSG() macros and fix indentation issues. Reviewed-by:
Joakim Bech <joakim.bech@linaro.org> Reviewed-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Use PRI* specifiers in trace messages using xMSG() macros. Add parentheses to explicit function labels. Remove function label from EMSG() trace messages as the macro already takes care of printing it. Reviewed-by:
Joakim Bech <joakim.bech@linaro.org> Reviewed-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Nov 30, 2023
-
-
Add case 6021 to test modifying and checking object usage of a persistent object. Link: https://github.com/OP-TEE/optee_os/issues/6495 Signed-off-by:
Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by:
Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
Fixes the error cleanup path in two places where a created test object was supposed to be removed. Fixes: 90f23353 ("Test Persistent Object with keys") Signed-off-by:
Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by:
Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Nov 23, 2023
-
-
There is quite a bit of copy in these files. So, I consolidate the code to make it easier to maintain. Signed-off-by:
Zexi Yu <yuzexi@hisilicon.com> Acked-by:
Jerome Forissier <jerome.forissier@linaro.org> [jf: edit commit subject, fix whitespace in ta_crypto_perf_priv.h] Signed-off-by:
Jerome Forissier <jerome.forissier@linaro.org> Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com> Acked-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
- Nov 22, 2023
-
-
Fix false positive error cases in tests pkcs11_1004 and pkcs11_1007. In the pkcs11_1004 test, the client creates as many PKCS#11 objects as possible until the system fails on memory allocation error. In the pkcs11_1007 test, the client prepares as many cipher sessions as possible until the system fails on memory allocation error. Both test implementations consider only CKR_DEVICE_MEMORY return code as the condition for expected resource exhaustion while they should also consider the host resource exhaustion return code CKR_HOST_MEMORY. Fixes: 2d6dc931 ("xtest: pkcs11: add symmetric cipher tests") Reviewed-by:
Joakim Bech <joakim.bech@linaro.org> Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by:
Etienne Carriere <etienne.carriere@foss.st.com>
-
- Nov 21, 2023
-
-
The *MSG() macros take care of printing a newline. Adding a newline character ('\n') is useless. Remove it. Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by:
Jerome Forissier <jerome.forissier@linaro.org>
-
- Nov 20, 2023
-
-
If OPENSSL_FOUND is not defined, compilation fails with below error: optee-test/host/xtest/pkcs11_1000.c: In function 'init_user_test_token_acl_auth': optee-test/host/xtest/pkcs11_1000.c:848:11: error: implicit declaration of function 'xtest_uuid_v5' [-Werror=implicit-function-declaration] 848 | result = xtest_uuid_v5(&expected_client_uuid, &uuid_ns, uuid_name, | ^~~~~~~~~~~~~ optee-test/host/xtest/pkcs11_1000.c:848:11: error: nested extern declaration of 'xtest_uuid_v5' [-Werror=nested-externs] To reproduce the above, pass "WITH_OPENSSL=n" to make or "-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=TRUE" to cmake. Add preprocessor directives to skip tests 1003 and 1027 if openssl is not present. Also exclude their unique dependencies to avoid getting some -Wunused-function alerts. Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com> Acked-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
As advised by the Linux kernel coding style [1] which OP-TEE follows: [...] don't leave whitespace at the end of lines. [1] https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com> Acked-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
Add a subtest to assert that the implementation allows to forward non-NULL memref from a TA to another TA. Regression 1016 already contains tests related to forwarding memref between TAs. Thus extend this existing test with the subtest described above instead of writing a new one. The Global Platform specification allows this, however, at the time of writing, optee-os will panic. A fix is proposed at [1]. [1] core: tee_svc.c: allow to pass non-NULL memref of size 0 Link: https://github.com/OP-TEE/optee_os/pull/6405 Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
The Global Platform specification [1] tells us that the session parameter of TEE_CloseTASession() is: An opened session handle The behaviour is unspecified if the session handle is not opened. Make sure not to call TEE_CloseTASession() with an invalid session handle when TEE_OpenTASession() fails by either: - doing an early return - adding an additional cleanup label [1] TEE Internal Core API Specification – Public Release v1.3.1, §4.9.2 "TEE_CloseTASession" Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
EMSG() already prints the caller function name (and the line number). As such, no need to hardcode it. Remove all usage of caller function name in EMSG(). Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
The TEE_ERROR_BAD_PARAMETERS return code should be prefered over TEE_ERROR_GENERIC for any failed check on the parameters. Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by:
Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
TA2TA_BUF_SIZE is used to defined some test arrays. Using a macro instead of a const int declaration is good as it forces the declared arrays not to be variable length arrays. However, TA2TA_BUF_SIZE is defined in the middle of the translation unit. Because its use is local to ta_entry_ta2ta_memref(), undefine it after the function to make the visibility of the macro scoped. Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
As advised by the Linux kernel coding style [1] which OP-TEE follows: [...] don't leave whitespace at the end of lines. [1] https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation Signed-off-by:
Vincent Mailhol <mailhol.vincent@wanadoo.fr> Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org>
-
The command 'xtest --stats --time' is now documented in the usage description. Acked-by:
Etienne Carriere <etienne.carriere@foss.st.com> Acked-by:
Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by:
Julien Jayat <jayatjulien@yahoo.fr>
-