Skip to content

optee-utee: support TEE_GetProperty APIs#190

Merged
DemesneGH merged 1 commit intoapache:mainfrom
DemesneGH:property
May 22, 2025
Merged

optee-utee: support TEE_GetProperty APIs#190
DemesneGH merged 1 commit intoapache:mainfrom
DemesneGH:property

Conversation

@DemesneGH
Copy link
Contributor

This PR introduces support for accessing TEE properties, as specified in the GlobalPlatform TEE Internal Core API Specification v1.3.1 (https://globalplatform.org/wp-content/uploads/2021/03/GPD_TEE_Internal_Core_API_Specification_v1.3.1_PublicRelease_CC.pdf):

  • [4.4] Property Access Functions
  • [4.5] Trusted Application Configuration Properties
  • [4.6] Client Properties
  • [4.7] Implementation Properties

Each property defined in Sections 4.5–4.7 of the spec has a corresponding definition in property.rs.

These properties enable a variety of use cases. For example, they enable retrieving metadata such as the TA description, allow a TA to determine the caller's origin (whether it was invoked by a CA or another TA), and retrieve the caller's UUID.

Please refer to the property-rs example for a demonstration of these use cases.

//
// let my_property = CurrentTaAppId.get()?;
// ```
define_property_key!(CurrentTaAppId, CurrentTa, "gpd.ta.appID", Uuid);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is to abstract the complexity of fetching properties under Property Sets by introducing dedicated types. The main concern is the naming convention used for these newly introduced types.

The suggested approach is to map type names directly from the corresponding property keys (or their suffixes). For example:

gpd.ta.doesNotCloseHandleOnCorruptObject → TaDoesNotCloseHandleOnCorruptObject

gpd.tee.apiversion → TeeApiVersion

gpd.ta.dataSize → TaDataSize

This naming convention allows developers to intuitively derive the type name from the GlobalPlatform documentation without needing to inspect the implementation details. It significantly improves developer experience and code readability.

);

// test the other property:
let core_version = TeeImplementationInternalCoreVersion.get()?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • As this logic serves as test case. Can we add assertion to the return value?

@DemesneGH DemesneGH force-pushed the property branch 2 times, most recently from b8d47a9 to 3d0d66f Compare May 22, 2025 03:53
@ivila
Copy link
Contributor

ivila commented May 22, 2025

Reviewed-by: Zehui Chen <ivila@apache.org> 😀

This commit introduces support for accessing TEE properties, as
specified in the
GlobalPlatform TEE Internal Core API Specification v1.3.1.

It also provide the `property-rs` example for demostration.

Signed-off-by: Yuan Zhuang <yuanz@apache.org>
Reviewed-by: Zehui Chen <ivila@apache.org>
@DemesneGH DemesneGH merged commit 7daee91 into apache:main May 22, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants