| 1ed12b2e | 06-Jan-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: avb: Add TA version and description property values
Add meaningful values for AVB TA version and description properties to replace previously embedded default respective values "Undefined versio
ta: avb: Add TA version and description property values
Add meaningful values for AVB TA version and description properties to replace previously embedded default respective values "Undefined version" and "Undefined description".
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 04e46975 | 16-Dec-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
tree-wide: use ROUNDUP_DIV() where applicable
Use ROUNDUP_DIV() instead of ROUNDUP(..., size) / size where applicable.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Je
tree-wide: use ROUNDUP_DIV() where applicable
Use ROUNDUP_DIV() instead of ROUNDUP(..., size) / size where applicable.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5395f036 | 06-Jan-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: set TA version ID to 1.0.0
PKCS#11 TA version ID is 0.1.0 since its early integration. Let's set it 1.0.0 since it now mature enough to deserve a non-zero major version number.
Signed-o
ta: pkcs11: set TA version ID to 1.0.0
PKCS#11 TA version ID is 0.1.0 since its early integration. Let's set it 1.0.0 since it now mature enough to deserve a non-zero major version number.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8cf8403b | 11-Dec-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: default disable CFG_PKCS11_TA_RSA_X_509
Disable CFG_PKCS11_TA_RSA_X_509 in pkcs11 TA default configuration since raw RSA signature (CKM_RSA_X_509) computation and verification can be uns
ta: pkcs11: default disable CFG_PKCS11_TA_RSA_X_509
Disable CFG_PKCS11_TA_RSA_X_509 in pkcs11 TA default configuration since raw RSA signature (CKM_RSA_X_509) computation and verification can be unsafe. Target systems willing to embed its support (e.g. for some TSL v1.2 support) will need to enable it explicitly.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| b7abff72 | 06-Sep-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: add CKM_RSA_X_509 ciphering
Add support for CKM_RSA_X_509 mechanism for encrypt/decrypt operations.
Signed-off-by: Alexandre Marechal <alexandre.marechal@st.com> Signed-off-by: Etienne
ta: pkcs11: add CKM_RSA_X_509 ciphering
Add support for CKM_RSA_X_509 mechanism for encrypt/decrypt operations.
Signed-off-by: Alexandre Marechal <alexandre.marechal@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
show more ...
|
| e02f17f3 | 24-Jul-2024 |
Alexandre Marechal <alexandre.marechal@st.com> |
ta: pkcs11: add CKM_RSA_X_509 authentication
Add support for CKM_RSA_X_509 mechanism for sing/verify operations.
Sign and verify operations are processed using TEE decrypt/encrypt operation since G
ta: pkcs11: add CKM_RSA_X_509 authentication
Add support for CKM_RSA_X_509 mechanism for sing/verify operations.
Sign and verify operations are processed using TEE decrypt/encrypt operation since GP TEE Internal Core API specification only allows these modes for TEE_ALG_RSA_NOPAD algorithm. The pkcs11 TA only support sign operation when the provided payload is exactly of the same size as the RSA key used and checks the generate signature is of right size.
This mechanism can be needed to support CKM_RSA_X_509 for TLSv1.2 connections.
Add CFG_PKCS11_TA_RSA_X_509 to allow configuring the pkcs11 TA with or without raw RSA crypto support. The config switch is default enabled.
Signed-off-by: Alexandre Marechal <alexandre.marechal@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
show more ...
|
| fc9ea0db | 19-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
ta_dev_kit.mk: use spec-srcs and spec-out-dir
The commit cfa34d9afb5c ("Add support for compiling in-tree TAs") added spec-srcs and spec-out-dir for special handling of user_ta_header.c when compili
ta_dev_kit.mk: use spec-srcs and spec-out-dir
The commit cfa34d9afb5c ("Add support for compiling in-tree TAs") added spec-srcs and spec-out-dir for special handling of user_ta_header.c when compiling in-tree TAs.
However, these variables are just as relevant for out-of-tree TAs compiled via ta/mk/ta_dev_kit.mk. So as a simplification switch to use spec-srcs and spec-out-dir in that file too.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 19662e41 | 20-Sep-2024 |
Jerome Forissier <jerome.forissier@linaro.org> |
ta: apply __no_stack_protector to __ta_entry() or __ta_entry_c()
Apply the __no_stack_protector attribute to the first C function called following the TA entry point (i.e., __ta_entry(), or for the
ta: apply __no_stack_protector to __ta_entry() or __ta_entry_c()
Apply the __no_stack_protector attribute to the first C function called following the TA entry point (i.e., __ta_entry(), or for the special case of ARM32, __ta_entry_c()). This is required because __stack_chk_guard is initialized in this very function, therefore stack protection cannot be assumed to be functional at this point.
Fixes a TA crash on QEMUv7 with Clang 18.1.7 [1].
Link: https://github.com/OP-TEE/optee_os/issues/7047 [1] 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> Reviewed-by: Khoa Hoang <admin@khoahoang.com>
show more ...
|
| 55a4d839 | 04-Sep-2024 |
Georges Savoundararadj <savoundg@amazon.com> |
ta: pkcs11: fix memory leak
On update_persistent_object_attributes failure, head_new (stored in obj->attributes) is not freed, causing a memory leak.
Reported-by: Christian Zoia <czoia@amazon.es> C
ta: pkcs11: fix memory leak
On update_persistent_object_attributes failure, head_new (stored in obj->attributes) is not freed, causing a memory leak.
Reported-by: Christian Zoia <czoia@amazon.es> Closes: https://github.com/OP-TEE/optee_os/issues/7023 Fixes: 6959626e1621 ("ta: pkcs11: preserve object when set attribute fails") Signed-off-by: Georges Savoundararadj <savoundg@amazon.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 5c669b6d | 28-Aug-2024 |
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> |
ta: remoteproc: add command to release remote processor firmware
This patch introduces a new command `TA_RPROC_CMD_RELEASE_FW` to release the firmware images and associated resources of a remote pro
ta: remoteproc: add command to release remote processor firmware
This patch introduces a new command `TA_RPROC_CMD_RELEASE_FW` to release the firmware images and associated resources of a remote processor.
This command can be called by the non-secure context to release the loaded firmware if the remoteproc is not running.
The command can be used, for instance, in case an error occurs in the non-secure context between the load request and the start of the remote processor. Calling the command allows releasing the loaded firmware and going back to the REMOTEPROC_OFF state.
This command should also be called after the stop of the remote processor to release associated resources.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 931c8c5e | 14-Aug-2024 |
Weizhao Jiang <weizhaoj@amazon.com> |
ta: pkcs11: write db_main and db_objs in one operation
Problem: There is a potential issue in persistent_token.c::init_persistent_db(). There are two steps to initialize a token DB if it doesn’t exi
ta: pkcs11: write db_main and db_objs in one operation
Problem: There is a potential issue in persistent_token.c::init_persistent_db(). There are two steps to initialize a token DB if it doesn’t exist: 1. Call TEE_CreatePersistentObject() with db_main as the initial data. 2. Truncate the object data and then insert db_obj data. If a power loss occurs between above two steps, only the db_main data is present in the database. When the device restarts, it detects the existing database and successfully reads db_main, but fails to read db_obj, leading to a TA panic each time. https://github.com/OP-TEE/optee_os/issues/6977
Solution: Write both db_main and the initial 4 bytes of db_objs (with a count of 0) in a single operation during TEE_CreatePersistentObject().
Tested-by: Weizhao Jiang <weizhaoj@amazon.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Weizhao Jiang <weizhaoj@amazon.com>
show more ...
|
| 3dc4089a | 24-Apr-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: correct RSA keys extended attributes sanitation
Fix RSA key attributes function load_tee_rsa_key_attrs() that badly checks that the 5 extended RSA attributes are found in the key object.
ta: pkcs11: correct RSA keys extended attributes sanitation
Fix RSA key attributes function load_tee_rsa_key_attrs() that badly checks that the 5 extended RSA attributes are found in the key object.
Link: https://github.com/OP-TEE/optee_test/issues/721#issuecomment-2068055537 Link: https://github.com/OP-TEE/optee_test/issues/721#issuecomment-2072064963 Fixes: 0442c956edfb ("ta: pkcs11: Add support for RSA signing & verification") Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
show more ...
|
| 5d2d37cd | 09-Feb-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: Clarify context reference in step_symm_operation()
Function step_symm_operation() defines a local variable to reference the session processing context but uses both session reference and
ta: pkcs11: Clarify context reference in step_symm_operation()
Function step_symm_operation() defines a local variable to reference the session processing context but uses both session reference and this local variable which can be confusing when reading the code. Change the implementation to only use the local variable for consistency. No functional changes.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| ad50321f | 08-Mar-2024 |
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> |
ta: remoteproc: allow remoteproc_load_fw re-entrance
Instead of returning an error if the TA_RPROC_CMD_LOAD_FW is called several times, just return TEE_SUCCESS if the firmware is already loaded.
Th
ta: remoteproc: allow remoteproc_load_fw re-entrance
Instead of returning an error if the TA_RPROC_CMD_LOAD_FW is called several times, just return TEE_SUCCESS if the firmware is already loaded.
This commit is the result of a discussion on Linux Kernel mailing list: https://lore.kernel.org/lkml/ZeCujRgH%2FodzU9og@p14s/
Fixes: fcf382e2440c ("ta: remoteproc: add remote processor Trusted Application")
Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 571857c0 | 15-Feb-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: factorize second operation handle
Factorize fields tee_hash_op_handle and tee_op_handle2 of struct active_processing that both are used as second operation handle for specific algorithm.
ta: pkcs11: factorize second operation handle
Factorize fields tee_hash_op_handle and tee_op_handle2 of struct active_processing that both are used as second operation handle for specific algorithm.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 63778faa | 12-Feb-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: implement AES GCM operations
Implement AES GCM authenticated encryption and decryption.
AES GCM decryption requires that the output data is revealed only once decryption is finalized an
ta: pkcs11: implement AES GCM operations
Implement AES GCM authenticated encryption and decryption.
AES GCM decryption requires that the output data is revealed only once decryption is finalized and the MAC signature successfully verified. For this operation, the AES GCM context references a dynamically allocated data buffer to store output data as they are generated by each call to TEE_AEUpdate().
AES GCM one-shot operation in the pkc11 TA is a bit specific in that it requires an extra TEE operation handle to save the initialized operation state in case of one shot processing request (C_Encrypt() or C_Decrypt() cryptoki API functions) that queries the output buffer size. GP TEE Internal Core API does not define a single API function for such one shot operation that could be called to query the output buffer size. We must first fully process the input data (TEE_AEUpdate()) before we can query the output buffer size with TEE_AEEncryptFinal() or TEE_AEDecryptFinal(). Consequently we will need to process again the input data when client provides a well sized output buffer as we are not sure that input data will be the same. Therefore the implementation allocates a 2nd operation handle, copy the operation state into after it is initialized and use this context to restore this initial state in case the one shot AE operation is returning PKCS11_CKR_BUFFER_TOO_SMALL.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> 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>
show more ...
|
| 5fee6cc9 | 16-Nov-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
ta: pkcs11: pkcs11_ta.h: define PKCS11_CKM_AES_GCM
Define PKCS11_CKM_AES_GCM setting its value to 0x01087 according to libckteec/include/pkcs11_ta.h from OP-TEE Client API.
Reviewed-by: Jerome Fori
ta: pkcs11: pkcs11_ta.h: define PKCS11_CKM_AES_GCM
Define PKCS11_CKM_AES_GCM setting its value to 0x01087 according to libckteec/include/pkcs11_ta.h from OP-TEE Client API.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 897aaf11 | 15-Feb-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: fix build warning on unused arguments
Add missing __maybe_unused attribute for function arguments not used when the pkcs11 TA is built with NDEBUG directive, as shown by the following bu
ta: pkcs11: fix build warning on unused arguments
Add missing __maybe_unused attribute for function arguments not used when the pkcs11 TA is built with NDEBUG directive, as shown by the following build trace message:
ta/pkcs11/src/pkcs11_attributes.c: In function ‘get_default_value’: ta/pkcs11/src/pkcs11_attributes.c:261:61: warning: unused parameter ‘id’ [-Wunused-parameter] 261 | static enum pkcs11_rc get_default_value(enum pkcs11_attr_id id, void **value, | ~~~~~~~~~~~~~~~~~~~~^~ ta/pkcs11/src/pkcs11_attributes.c: In function ‘check_created_attrs_against_processing’: ta/pkcs11/src/pkcs11_attributes.c:1647:73: warning: unused parameter ‘head’ [-Wunused-parameter] 1647 | struct obj_attrs *head) | ~~~~~~~~~~~~~~~~~~^~~~
Fixes: 63f89caa9022 ("ta: pkcs11: attribute helper functions") Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| a2431e9f | 05-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
ta: pkcs11: check returned value of mbedtls_pk_rsa()
Check returned pointer of mbedtls_pk_rsa() as it can return NULL.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Foris
ta: pkcs11: check returned value of mbedtls_pk_rsa()
Check returned pointer of mbedtls_pk_rsa() as it can return NULL.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 4bc2a199 | 10-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
ta: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <
ta: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 6959626e | 15-Dec-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: preserve object when set attribute fails
Preserve original object attributes when C_SetAttributeValue service fails instead of possibly changing object attributes before the whole new at
ta: pkcs11: preserve object when set attribute fails
Preserve original object attributes when C_SetAttributeValue service fails instead of possibly changing object attributes before the whole new attribute set is validated.
Fixes: bcac2127a7f1 ("ta: pkcs11: pkcs11_attributes.c: support PKCS11_CKA_CHECK_VALUE") Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 2ea9746d | 15-Dec-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: treat bad KCV size as a bad value case
Return PKCS11_CKR_ATTRIBUTE_VALUE_INVALID instead of a template inconsistency when the key check value attribute is wrong due to its size.
Fixes:
ta: pkcs11: treat bad KCV size as a bad value case
Return PKCS11_CKR_ATTRIBUTE_VALUE_INVALID instead of a template inconsistency when the key check value attribute is wrong due to its size.
Fixes: bcac2127a7f1 ("ta: pkcs11: pkcs11_attributes.c: support PKCS11_CKA_CHECK_VALUE") Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 69de4b2d | 08-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: default enable key check value support
Default enable support for key check value attribute in pkcs11 TA.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne
ta: pkcs11: default enable key check value support
Default enable support for key check value attribute in pkcs11 TA.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 3bc92b91 | 08-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: use TEE_InitRefAttribute() to compute key check value
Use TEE_InitRefAttribute() helper function to set key data attribute in compute_check_value_with_ecb().
Fixes: bcac2127a7f1 ("ta: p
ta: pkcs11: use TEE_InitRefAttribute() to compute key check value
Use TEE_InitRefAttribute() helper function to set key data attribute in compute_check_value_with_ecb().
Fixes: bcac2127a7f1 ("ta: pkcs11: pkcs11_attributes.c: support PKCS11_CKA_CHECK_VALUE") Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| cfbe7874 | 08-Jan-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
ta: pkcs11: key check value may not be applicable
Key check value attribute is required only for objects of types certificate and symmetric keys. Fix set_check_value_attr() to return a successful st
ta: pkcs11: key check value may not be applicable
Key check value attribute is required only for objects of types certificate and symmetric keys. Fix set_check_value_attr() to return a successful status instead of bad argument error code when there is no key check value attribute to compute.
Fixes: bcac2127a7f1 ("ta: pkcs11: pkcs11_attributes.c: support PKCS11_CKA_CHECK_VALUE") Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|