The current project mainly includes the implementation of TA, CA and set_model tools in openvela.
Among them, CA/TA is implemented based on the standard GP API. If our current device supports TEE, then we call openvela running in TEEopenvela TEE, and openvela running in a normal environment openvela AP.
Among them, CA runs in openvela AP, and TA runs in openvela TEE.
The overall communication process between CA and TA in openvela is as follows:
comsst CA is a CA program for communicating with comsst TA, which includes the input, read, verify and delete operations of comsst.
comsst CA itself is a complete CA program, but users can also choose to define their own logic based on the API provided by comsst CA for secondary development.
pin CA
pin CA is a CA program for communicating with pin TA, which includes the acquisition, storage, deletion and verification operations of pin.
pin CA itself is a complete CA program, but users can also choose to define their own logic based on the API provided by pin CA for secondary development.
triad CA
triad CA is a CA program used to communicate with triad TA, which includes the acquisition, deletion and update operations of the device key, did and did hmac.
triad CA itself is a complete CA program, but users can also define their own logic based on the API provided by triad CA for secondary development.
2 TA
comsst TA
comsst TA is mainly used to call the underlying TEE API to implement the input, read, verify and delete operations of comsst.
pin TA
pin TA is mainly used to call the underlying TEE API to implement the input, read, update, delete and verify operations of pin.
triad TA
triad TA is mainly used to call the underlying TEE API to implement the read, delete and write operations of the system key and did.
3 tools
tools mainly includes a set_model tool.
set_model tool is mainly used to store some key information of the device, such as the device’s sn code, wifi mac address, bluetooth mac address, and the device’s unique identifier did and other information.
The internal implementation principle of set_model is to save these key information through kvdb.
The specific location where these data are saved can be specified by passing the specified parameters to the set_model tool to specify the specific storage path.
Usage Guide
1 CA
comsst CA
First, turn on the CONFIG_CA_COMSST_API option in openvela AP.
Then, in the current project, a test program comsst api demo that fully uses the comsst CA API is provided.
pin CA
First, turn on the CONFIG_CA_PIN_API option in openvela AP.
Then, in the current project, a test program pin api demo that fully uses the pin CA API is provided.
triad CA
First, turn on the CONFIG_CA_TRIAD_API option in openvela AP.
Then, in the current project, a test program triad api demo that fully uses the triad CA API is provided.
2 TA
If we need to use the TA program in openvela, we need to enable the following configuration options in openvela TEE:
CONFIG_INTERPRETERS_WAMR=y
CONFIG_INTERPRETERS_WAMR_AOT=y
CONFIG_INTERPRETERS_WAMR_BUILD_MODULES_FOR_NUTTX=y
CONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y
CONFIG_TA_TRIAD=y # If you use triad TA, you need to open this option
CONFIG_TA_COMSST=y # If you use comsst TA, you need to open this option
CONFIG_TA_PIN=y # If you use pin TA, you need to open this option
3 set_model
When using the set_model tool, we first need to turn on the CONFIG_SC_SET_MODEL option.
Since the set_model tool itself has many sub-functions, we need to turn on the corresponding options when using the corresponding functions.
The set_model tool is a command-line tool that can be run directly in nsh.
Below are the commands, parameters, and corresponding configuration options for running the set_model tool in nsh:
Command
Expected Result
Corresponding Configuration Options
set_model set sn 55119/F3YN00102
[ INFO] [ap] Set sn=55119/F3YN00102 success
SC_SET_MODEL_PRODUCT_ID
set_model set mac_wifi CC:D8:43:20:C4:22
[ INFO] [ap] Set mac_wifi=CC:D8:43:20:C4:22 success
SC_SET_MODEL_PRODUCT_HARDWARE
set_model set mac_bt CC:D8:43:20:C4:22
[ INFO] [ap] Set mac_bt=CC:D8:43:20:C4:22 success
SC_SET_MODEL_PRODUCT_HARDWARE
set_model set miio_did 771897593
[ INFO] [ap] Set miio_did=771897593 success
SC_SET_MODEL_PRODUCT_APP_ID
set_model set miio_key 0000000000000001
[ INFO] [ap] Set miio_key=0000000000000001 success
SC_SET_MODEL_PRODUCT_ID
set_model set color_id 0
[ INFO] [ap] Set color_id=0 success
SC_SET_MODEL_PRIORITY
set_model set color_desc 000000000000000
[ INFO] [ap] Set color_desc=000000000000000 success
SC_SET_MODEL_PRIORITY
set_model get
[ INFO] [ap] get /data/etc/device.info success
SC_SET_MODEL_PRIORITY
set_model setpsm
[ INFO] [ap] Writing psm path and set property success
Security
[English | 中文]
Project Overview
The current project mainly includes the implementation of
TA,CAandset_modeltools inopenvela.Among them,
CA/TAis implemented based on the standard GP API. If our current device supportsTEE, then we callopenvelarunning inTEEopenvela TEE, andopenvelarunning in a normal environmentopenvela AP.Among them,
CAruns inopenvela AP, andTAruns inopenvela TEE. The overall communication process betweenCAandTAinopenvelais as follows:Project Description
CA
1 CA
comsst CA
comsst CAis aCAprogram for communicating withcomsst TA, which includes the input, read, verify and delete operations ofcomsst.comsst CAitself is a completeCAprogram, but users can also choose to define their own logic based on the API provided bycomsst CAfor secondary development.pin CA
pin CAis aCAprogram for communicating withpin TA, which includes the acquisition, storage, deletion and verification operations ofpin.pin CAitself is a completeCAprogram, but users can also choose to define their own logic based on the API provided bypin CAfor secondary development.triad CA
triad CAis aCAprogram used to communicate withtriad TA, which includes the acquisition, deletion and update operations of the devicekey,didanddid hmac.triad CAitself is a completeCAprogram, but users can also define their own logic based on the API provided bytriad CAfor secondary development.2 TA
comsst TA
comsst TAis mainly used to call the underlyingTEE APIto implement the input, read, verify and delete operations ofcomsst.pin TA
pin TAis mainly used to call the underlyingTEE APIto implement the input, read, update, delete and verify operations ofpin.triad TA
triad TAis mainly used to call the underlyingTEE APIto implement the read, delete and write operations of the systemkeyanddid.3 tools
toolsmainly includes aset_modeltool.set_modeltool is mainly used to store some key information of the device, such as the device’ssncode,wifi macaddress,bluetooth macaddress, and the device’s unique identifierdidand other information.The internal implementation principle of
set_modelis to save these key information throughkvdb.The specific location where these data are saved can be specified by passing the specified parameters to the
set_modeltool to specify the specific storage path.Usage Guide
1 CA
comsst CA
First, turn on the
CONFIG_CA_COMSST_APIoption inopenvela AP. Then, in the current project, a test program comsst api demo that fully uses thecomsst CA APIis provided.pin CA
First, turn on the
CONFIG_CA_PIN_APIoption inopenvela AP. Then, in the current project, a test program pin api demo that fully uses thepin CA APIis provided.triad CA
First, turn on the
CONFIG_CA_TRIAD_APIoption inopenvela AP. Then, in the current project, a test program triad api demo that fully uses thetriad CA APIis provided.2 TA
If we need to use the
TAprogram inopenvela, we need to enable the following configuration options inopenvela TEE:3 set_model
When using the
set_modeltool, we first need to turn on theCONFIG_SC_SET_MODELoption.Since the
set_modeltool itself has many sub-functions, we need to turn on the corresponding options when using the corresponding functions.The
set_modeltool is a command-line tool that can be run directly innsh.Below are the commands, parameters, and corresponding configuration options for running the
set_modeltool innsh: