samples/tfm_integration/tfm_secure_partition/README.html · samples/tfm_integration/tfm_secure_partition/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · TF-M

TF-M Secure Partition

격리된 partition의 secret hash service를 secure firmware에 포함합니다.

Official pathsamples/tfm_integration/tfm_secure_partition/README.html
Source filesamples/tfm_integration/tfm_secure_partition/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Dummy partition 구성·이름 변경·IPC/Library build와 digest 출력을 설명합니다.

Isolation

Secure Partition

Service

5 secret hashes

Caller

Non-secure firmware

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 3981CF757A6D9E5D62D28698405078D59A1CF52009C382D06C6B8F4EDF450C8B
.. _tfm_secure_partition:

TF-M Secure Partition Sample
############################

Overview
********

A Secure Partition is an isolated module that resides in TF-M. It exposes a number of functions or
"secure services" to other partitions and/or to the non-secure firmware. TF-M already contains
standard partitions such as crypto, protected_storage, or firmware_update, but it's also possible to
create your own partitions.

This sample creates a dummy secure partition and secure service for TF-M and instructs the TF-M
build system to build it into the secure firmware. The dummy secure service is then called in the
main file (in the non-secure firmware).

This dummy partition has a single secure service, which can index one of 5 dummy secrets inside the
partition, and retrieve a hash of the secret.

The partition is located in the ``dummy_partition`` directory. It contains the partition sources,
build files and build configuration files. The partition is built by the TF-M build system, refer to
:ref:`tfm_build_system` for more details.

For more information on how to add custom secure partitions refer to TF-M's guide:
https://tf-m-user-guide.trustedfirmware.org/integration_guide/services/tfm_secure_partition_addition.html

When adapting this partition for your own purposes, please change all occurrences of
"dummy_partition", "DUMMY_PARTITION", "dp", and "DP" to your own partition name. Also, look through
both the secure and non-secure CMakeLists.txt file and make relevant changes, as well as the yaml
files inside "partition".

Building and Running
********************

This sample can be built with or without CONFIG_TFM_IPC, since it contains code for both.

On Target
=========

Refer to :ref:`tfm_ipc` for detailed instructions.

On QEMU
=======

Refer to :ref:`tfm_ipc` for detailed instructions.

Sample Output
=============

   .. code-block:: console

      *** Booting Zephyr OS build zephyr-v3.0.0-3061-g9bb87f4d46e9  ***
      Digest: be45cb2605bf36bebde684841a28f0fd43c69850a3dce5fedba69928ee3a8991
      Digest: 1452c8f04245d355722fdbfb03c69bcfd380b7dff911a3e425013397251f6a4e
      Digest: d3b4349010abb691b9584b6fd6b41ec54596ef7b98d853fb4f5bfa690f50f222
      Digest: 5afbcfede855ca834ff5b4e8a44a32206a51381f3cf52f5001a3241f017ac41a
      Digest: 983318380c325099da63de2e7ca57c1630693b28b4754e08817533295dbfcfbb
      No valid secret for key, received expected error code

Part 3

한국어 전문 번역

개요

Secure Partition은 TF-M 안에 존재하는 격리 module입니다. 다른 partition이나 non-secure firmware에 여러 function, 즉 secure service를 제공합니다. TF-M에는 crypto, protected_storage, firmware_update 같은 standard partition이 이미 있지만 custom partition도 만들 수 있습니다.

이 sample은 dummy secure partition과 secure service를 만들고 TF-M build system이 이를 secure firmware에 포함하도록 합니다. 그런 다음 non-secure firmware의 main file에서 dummy secure service를 호출합니다.

Dummy partition에는 secure service가 하나 있습니다. Partition 내부의 dummy secret 5개 중 하나를 index로 선택하고 그 secret의 hash를 가져옵니다.

Partition은 dummy_partition directory에 있으며 partition source, build file과 build configuration file을 포함합니다. TF-M build system이 이를 build하며 자세한 내용은 TF-M build system 문서를 참고합니다.

Custom secure partition을 추가하는 자세한 방법은 TF-M secure partition addition guide를 참고합니다.

이 partition을 실제 용도로 바꿀 때는 dummy_partition, DUMMY_PARTITION, dp, DP를 모두 새 partition 이름으로 변경해야 합니다. Secure·non-secure 양쪽 CMakeLists.txt와 partition 내부 YAML file도 검토해 필요한 항목을 바꿉니다.

빌드 및 실행

이 sample에는 두 방식의 code가 모두 있으므로 CONFIG_TFM_IPC를 활성화하거나 비활성화한 상태에서 build할 수 있습니다.

실제 Target

자세한 build·flash instruction은 TF-M IPC sample을 참고합니다.

QEMU

자세한 QEMU 실행 instruction도 TF-M IPC sample을 참고합니다.

샘플 출력

Sample은 dummy secret 5개 각각의 SHA-256 digest를 출력합니다. 유효하지 않은 key를 요청하면 secret을 찾지 못하고 예상한 error code를 받았음을 확인합니다.

*** Booting Zephyr OS build zephyr-v3.0.0-3061-g9bb87f4d46e9  ***
Digest: be45cb2605bf36bebde684841a28f0fd43c69850a3dce5fedba69928ee3a8991
Digest: 1452c8f04245d355722fdbfb03c69bcfd380b7dff911a3e425013397251f6a4e
Digest: d3b4349010abb691b9584b6fd6b41ec54596ef7b98d853fb4f5bfa690f50f222
Digest: 5afbcfede855ca834ff5b4e8a44a32206a51381f3cf52f5001a3241f017ac41a
Digest: 983318380c325099da63de2e7ca57c1630693b28b4754e08817533295dbfcfbb
No valid secret for key, received expected error code

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.