Software Architecture#

The TPM component, either fTPM or a hardware-based discrete TPM (DTPM), relies on the TPM Software Stack (TSS) to communicate with the TPM. The fTPM software architecture includes an fTPM TA running in OP-TEE with TSS support in the non-secure world.

Conceptual diagram of fTPM Software Architecture, showing relationship between elements of user space, non-secure world, and secure world

Non-secure World#

The software modules in the non-secure world:

  • TSS: User space applications depend on TSS to utilize the secure functionalities of the TPM. TSS combines multiple layers, including application-level APIs, underlying communication interfaces, and resource management frameworks. The open source implementation tpm2-software/tpm2-tss is available on GitHub and consists of the following components:

  • `TPM 2.0 tools <https://tpm2-tools.readthedocs.io/en/latest/>`__: A set of command-line tools for controlling the TPM. The open source implementation tpm2-software/tpm2-tools is available on GitHub.

  • fTPM driver: A client application (CA) that receives the TPM command byte stream and forwards it to the fTPM TA in the secure world.

  • OP-TEE driver: Provides the TA/CA communication interface.

Secure World#

The software modules in the secure world:

  • Secure Monitor: S-EL3 firmware that handles communication between secure and non-secure worlds.

  • Secure Partition Manager (SPM): S-EL2 firmware that manages secure partitions. For details, refer to Hafnium Secure Partition Manager.

  • OP-TEE OS: A Trusted OS (TOS) running in S-EL1 to provide security services in the TrustZone.

  • fTPM Helper PTA: Provides major functions to support fTPM provisioning, EPS generation, and EK certificate provisioning.

  • fTPM TA: Implements TPM command processing and platform-dependent TA functionality in accordance with the TCG TPM 2.0 specification, built on the TCG reference implementation from ms-tpm-20-ref and the platform-specific implementation from optee_ftpm.

  • MB2: The secure bootloader that derives the fTPM seed from the hardware fuse. The fTPM seed is a per-device, unique, secure value used for EPS generation.

  • Encrypted Keyblob (EKB): Packages per-device unique properties for fTPM provisioning support.