Skip to content

Integration of the OP-TEE client open header files with needed definitions #61031

@oleksiimoisieiev

Description

@oleksiimoisieiev

Origin

Integration of the OP-TEE open headers in terms of the PR which introducing OP-TEE driver to Zephyr.

Purpose

OP_TEE is a Trusted Execution Environment (TEE) which was designed to run Trusted Applications (TAs) secured from the Rich Execution Environment (REE) using ARM TrustZone technology. See Docs for details. The proposed changes are introducing OP-TEE driver and TEE subsystem to communicate with OP-TEE from Zephyr REE.

Mode of integration

The following headers should be integrated into the Zephyr main tree:

  1. tee.h - Generic API to TEE subsystem that should be implemented by OP-TEE driver
    origin: optee_client
    revision: 3.18.0
    place in Zephyr main tree: include/zephyr/drivers
  2. optee_msg.h - defines the OP-TEE message protocol to communicate with OP-TEE instance running in Secure World
    origin: optee_os
    revision: 3.18.0
    place in Zephyr main tree: drivers/tee/optee
  3. optee_rpc_cmd.h - RPC defines and structure to communicate with Secure World.
    origin: optee_os
    revision: 3.18.0
    place in Zephyr main tree: drivers/tee/optee
  4. optee_smc.h - defines SMC interface between Normal World and Secure World
    origin: optee_os
    revision: 3.18.0
    place in Zephyr main tree: drivers/tee/optee

Maintainership

Those headers are maintained by Linaro (according to the license information from the header License comment). But they had to be changed to match Zephyr code style and to be compatible with existing Zephyr definitions and the Device Driver model. That's why I propose myself as a maintainer candidate. These external sources were added in terms of the new feature, which should have a maintainer.

Pull Request

The following PR Introduces TEE subsystem support and OP-TEE OS driver to Zephyr.

Description

Global Platform provides the Technology of the Trusted Execution Environment (TEE) see link for the details. TEE is the secure area on the main processor that ensures that all sensitive data is stored, processed and protected in an isolated and trusted environment. TEE offers save execution of the authorized security software (Trusted Applications - TAs) and protects device and TA assets.
GlobalPlatform defines the following security features:

  1. Isolation from Rich OS;
  2. Isolation from Other TAs;
  3. App management control;
  4. Identifications and binding;
  5. Trusted Storage;
  6. Trusted Access to the peripherals;
  7. Cryptography.

OP-TEE OS is an implementation of TEE using ARM TrustZone technology: link. It provides OS running on the secure privileged layer, set of secure user space libraries for TAs and API for REE to manipulate with TAs via SMC.
Zephyr OP-TEE driver implements SMC connection to the OP-TEE OS and implements TEE Internal Core API .

This allows using main TEE features, mentioned above. optee_client library, ported as Zephyr Module (will be posted after merging OP-TEE driver) link implements TEE Client API with tee-supplicant support, which should provide TAs from the user-space and manage Secure Storage.

Changes may be tested by using ported xtest: zephyr-optee-test

TEE allows Zephyr application to use TAs functionality, store secure keys and support crypto standards, such as PKCS11. OP-TEE also provides Key generation functionality and storage. TA's could be provided by Zephyr application or to be compiled inside OP-TEE.

Dependencies

OP-TEE driver, according to About page should be compatible with TEE Internal Core API v1.3.1 and TEE Client API v1.0. So OP-TEE OS and OP-TEE client library should be compatible with the same API revisions.

There is no direct dependency for Zephyr. It provides API abstraction for the Client library and has SMC interface to the OP-TEE OS.

Revision

Implementation was based on revision 3.18.0 of optee_os and optee_client. Please see Mode of integration section for the details.

License

All headers are licensed under:
BSD-2-Clause

Metadata

Metadata

Labels

StaleTSCTopics that need TSC discussion

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions