Skip to content

Commit 8f117c7

Browse files
committed
refactor(esp_tee): Add local components in TEE examples via idf_component.yml
1 parent b88f30a commit 8f117c7

File tree

20 files changed

+50
-47
lines changed

20 files changed

+50
-47
lines changed

components/esp_tee/test_apps/tee_cli_app/CMakeLists.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@
22
# in this exact order for cmake to work correctly
33
cmake_minimum_required(VERSION 3.16)
44

5-
# (Not part of the boilerplate)
6-
# This example uses extra components for the following -
7-
# 1. common functions such as Wi-Fi and Ethernet connection.
8-
# 2. managing TEE OTA updates
9-
# 3. dumping TEE attestation info
10-
# 4. TEE Secure storage
11-
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_ota_ops
12-
$ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_attestation
13-
$ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_sec_storage)
14-
155
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
166

17-
# Including the attestation service calls
7+
# For registering the attestation secure service
188
include($ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_attestation/esp_tee_att.cmake)
199

2010
project(tee_cli)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dependencies:
2+
tee_attestation:
3+
path: ${IDF_PATH}/components/esp_tee/subproject/components/tee_attestation
4+
tee_ota_ops:
5+
path: ${IDF_PATH}/components/esp_tee/subproject/components/tee_ota_ops
6+
tee_sec_storage:
7+
path: ${IDF_PATH}/components/esp_tee/subproject/components/tee_sec_storage

components/esp_tee/test_apps/tee_test_fw/CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
#This is the project CMakeLists.txt file for the test subproject
22
cmake_minimum_required(VERSION 3.16)
33

4-
# This example uses extra components for the following -
5-
# 1. Test framework related.
6-
# 2. Managing TEE OTA updates
7-
# 3. TEE Secure Storage
8-
# 4. TEE Entity Attestation
9-
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/tools/unit-test-app/components
10-
$ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_ota_ops
11-
$ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_sec_storage
12-
$ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_attestation)
13-
144
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
155

6+
# For registering the test-specific and attestation secure services
167
include(${CMAKE_CURRENT_LIST_DIR}/components/test_sec_srv/test_tee_project.cmake)
178
include($ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_attestation/esp_tee_att.cmake)
189

components/esp_tee/test_apps/tee_test_fw/components/test_sec_srv/test_tee_project.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# tee_project.cmake file must be manually included in the project's top level CMakeLists.txt before project()
1+
# This file must be manually included in the project's top level CMakeLists.txt before project()
22
# This ensures that the variables are set before TEE starts building
33

44
get_filename_component(directory "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE DIRECTORY)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
dependencies:
22
ccomp_timer: "^1.0.0"
3+
tee_attestation:
4+
path: ${IDF_PATH}/components/esp_tee/subproject/components/tee_attestation
5+
tee_ota_ops:
6+
path: ${IDF_PATH}/components/esp_tee/subproject/components/tee_ota_ops
7+
tee_sec_storage:
8+
path: ${IDF_PATH}/components/esp_tee/subproject/components/tee_sec_storage
9+
test_utils:
10+
path: ${IDF_PATH}/tools/unit-test-app/components/test_utils

docs/en/security/tee/tee-attestation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ API Reference
255255

256256
.. note::
257257

258-
- To use the TEE Attestation APIs into your project, ensure the :component:`tee_attestation <esp_tee/subproject/components/tee_attestation>` component is included by setting ``EXTRA_COMPONENT_DIRS`` in your project's ``CMakeLists.txt`` file, as shown in the :example:`tee_attestation <security/tee/tee_attestation>` example. For more information, refer to the :ref:`optional_project_variable` section from the :doc:`Build System </api-guides/build-system>` documentation.
258+
- To use the TEE Attestation APIs in your project, ensure that the :component:`tee_attestation <esp_tee/subproject/components/tee_attestation>` component is listed as a local dependency in the component manager manifest file `idf_component.yml <https://docs.espressif.com/projects/idf-component-manager/en/latest/reference/manifest_file.html>`_. Refer to the :example:`tee_attestation <security/tee/tee_attestation>` example for guidance.
259259

260260
- Additionally, the component-specific :component_file:`CMake <esp_tee/subproject/components/tee_attestation/esp_tee_att.cmake>` file needs to be included in the top-level ``CMakeLists.txt`` of your project before calling the ``project()`` command to integrate the corresponding service calls into the project.
261261

docs/en/security/tee/tee-ota.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ API Reference
7474

7575
.. note::
7676

77-
To use the TEE OTA APIs into your project, ensure the :component:`tee_ota_ops <esp_tee/subproject/components/tee_ota_ops>` component is included by setting ``EXTRA_COMPONENT_DIRS`` in your project's ``CMakeLists.txt`` file, as shown in the :example:`tee_secure_ota <security/tee/tee_secure_ota>` example. For more information, refer to the :ref:`optional_project_variable` section from the :doc:`Build System </api-guides/build-system>` documentation.
77+
To use the TEE OTA APIs in your project, ensure that the :component:`tee_ota_ops <esp_tee/subproject/components/tee_ota_ops>` component is listed as a local dependency in the component manager manifest file `idf_component.yml <https://docs.espressif.com/projects/idf-component-manager/en/latest/reference/manifest_file.html>`_. Refer to the :example:`tee_secure_ota <security/tee/tee_secure_ota>` example for guidance.
7878

7979
.. include-build-file:: inc/esp_tee_ota_ops.inc

docs/en/security/tee/tee-sec-storage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ API Reference
112112

113113
.. note::
114114

115-
To use the TEE Secure Storage APIs into your project, ensure the :component:`tee_sec_storage <esp_tee/subproject/components/tee_sec_storage>` component is included by setting ``EXTRA_COMPONENT_DIRS`` in your project's ``CMakeLists.txt`` file, as shown in the :example:`tee_secure_storage <security/tee/tee_secure_storage>` example. For more information, refer to the :ref:`optional_project_variable` section from the :doc:`Build System </api-guides/build-system>` documentation.
115+
To use the TEE Secure Storage APIs in your project, ensure that the :component:`tee_sec_storage <esp_tee/subproject/components/tee_sec_storage>` component is listed as a local dependency in the component manager manifest file `idf_component.yml <https://docs.espressif.com/projects/idf-component-manager/en/latest/reference/manifest_file.html>`_. Refer to the :example:`tee_secure_storage <security/tee/tee_secure_storage>` example for guidance.
116116

117117
.. include-build-file:: inc/esp_tee_sec_storage.inc

examples/security/tee/tee_attestation/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
# in this exact order for cmake to work correctly
33
cmake_minimum_required(VERSION 3.16)
44

5-
# (Not part of the boilerplate)
6-
# This example uses extra components for the following -
7-
# 1. Printing TEE attestation info
8-
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_attestation)
9-
105
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
116

12-
# Including the attestation service calls
7+
# For registering the attestation secure service
138
include($ENV{IDF_PATH}/components/esp_tee/subproject/components/tee_attestation/esp_tee_att.cmake)
149

10+
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
11+
idf_build_set_property(MINIMAL_BUILD ON)
1512
project(tee_attestation)

examples/security/tee/tee_attestation/main/app_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
#include <errno.h>
99

1010
#include "esp_system.h"
11-
#include "esp_event.h"
1211
#include "esp_log.h"
13-
#include "esp_console.h"
1412

1513
#include "freertos/FreeRTOS.h"
1614
#include "freertos/task.h"

0 commit comments

Comments
 (0)