optee-utee: support TEE_GetProperty APIs#190
Conversation
optee-utee/src/property.rs
Outdated
| // | ||
| // let my_property = CurrentTaAppId.get()?; | ||
| // ``` | ||
| define_property_key!(CurrentTaAppId, CurrentTa, "gpd.ta.appID", Uuid); |
There was a problem hiding this comment.
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.
examples/property-rs/ta/src/main.rs
Outdated
| ); | ||
|
|
||
| // test the other property: | ||
| let core_version = TeeImplementationInternalCoreVersion.get()?; |
There was a problem hiding this comment.
- As this logic serves as test case. Can we add assertion to the return value?
b8d47a9 to
3d0d66f
Compare
|
|
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>
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):
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-rsexample for a demonstration of these use cases.