Skip to content

Commit 6b61c3a

Browse files
MarkusLassilarlubos
authored andcommitted
tfm: Improve use-case for missing provisioning
Add documentation for TF-M provisioning and error messages for missing provisioning with CONFIG_TFM_NRF_PROVISIONING. Signed-off-by: Markus Lassila <[email protected]>
1 parent cae041c commit 6b61c3a

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

doc/nrf/libraries/security/identity_key.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The identity key library manages an asymmetric key used for identity services on
1111
It's used to provision identity keys and can only be used by a Zephyr image in Secure Processing Environment (SPE).
1212
It is not supported from images for Non-Secure Processing Environment (NSPE), from a Trusted Firmware-M image, or from MCUboot.
1313

14-
The identity key is equivalent to the Initial Attestation Key (IAK), as described in the ARM Platform Security Model 1.1, when Trusted Firmware-M (TF-M) is enabled.
14+
The identity key is equivalent to the Initial Attestation Key (IAK), as described in the `ARM Platform Security Model 1.1`_, when Trusted Firmware-M (TF-M) is enabled.
1515
TF-M has access to the identity key using internal APIs and does not need to use this library.
1616

1717
Functionality

doc/nrf/links.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,7 @@
14171417
.. _`GNU Arm Embedded Toolchain`: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads
14181418
.. _`IDAU`: https://developer.arm.com/docs/100690/latest/attribution-units-sau-and-idau
14191419
.. _`ARM CoreSight`: https://developer.arm.com/documentation/100536/0302
1420+
.. _`ARM Platform Security Model 1.1`: https://developer.arm.com/documentation/den0128/0101b/
14201421

14211422
.. ### Source: etsi.org
14221423

doc/nrf/security/tfm.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ By using the :kconfig:option:`CONFIG_TFM_SECURE_UART0`. the TF-M UART instance b
126126

127127
When the TF-M and application use the same UART, the TF-M will disable logging after it has booted and it will only re-enable it again to log a fatal error.
128128

129+
Provisioning
130+
************
131+
132+
For the devices that need provisioning, TF-M implements the following Platform Root of Trust (PRoT) Security Lifecycle states that conform to the `ARM Platform Security Model 1.1`_:
133+
134+
* Device Assembly and Test
135+
* PRoT Provisioning
136+
* Secured
137+
138+
The device starts in the **Device Assembly and Test** state.
139+
The :ref:`provisioning_image` sample shows how to move the device from the **Device Assembly and Test** state to the **PRoT Provisioning** state, and how to provision the device with hardware unique keys (HUKs) and an identity key.
140+
141+
To move the device from the **PRoT Provisioning** state to the **Secured** state, set the :kconfig:option:`CONFIG_TFM_NRF_PROVISIONING` Kconfig option for your application.
142+
In the first boot, TF-M will ensure that the keys are stored in the Key Management Unit (KMU) and move the device to the **Secured** state.
143+
The :ref:`tfm_psa_template` sample shows how to achieve this.
144+
129145
.. _ug_tfm_manual_VCOM_connection:
130146

131147
Manual connection to Virtual COM ports on the nRF5340 DK

modules/trusted-firmware-m/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ config TFM_NRF_PROVISIONING
468468
select SECURE_BOOT_STORAGE
469469
help
470470
Provision the TF-M image. When enabled, TF-M must be in the PSA
471-
provisioning lifecycle state in order to boot. See provisioning
472-
guide for more details.
471+
provisioning lifecycle state in order to boot. Find more information
472+
about provisioning in Running applications with Trusted Firmware-M.
473473

474474
config TFM_PSA_FRAMEWORK_HAS_MM_IOVEC
475475
bool

modules/trusted-firmware-m/tfm_boards/common/tfm_hal_platform.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ enum tfm_hal_status_t tfm_hal_platform_init(void)
147147
enum tfm_security_lifecycle_t lcs = tfm_attest_hal_get_security_lifecycle();
148148

149149
if (lcs != TFM_SLC_PSA_ROT_PROVISIONING && lcs != TFM_SLC_SECURED) {
150+
SPMLOG_ERRMSGVAL("Invalid LCS: ", lcs);
151+
SPMLOG_DBGMSG("Ensure that the device has been provisioned.\r\n");
150152
return TFM_HAL_ERROR_BAD_STATE;
151153
}
152154
#endif /* defined(NRF_PROVISIONING) */

samples/tfm/provisioning_image/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Running the provisioning image sample will initialize the provisioning process o
1111
This sample does not include a TF-M image, it is a Zephyr image intended to be flashed, run, and erased before the TF-M image is flashed.
1212

1313
After completion, the device is in the Platform Root-of-Trust (PRoT) security lifecycle state called **PRoT Provisioning**.
14-
For more information about the PRoT security lifecycle, see Arm's Platform Security Model 1.1 defined in the Platform Security Architecture (PSA).
14+
For more information about the PRoT security lifecycle, see `ARM Platform Security Model 1.1`_.
1515

1616
When built for the nrf5340dk/nrf5340/cpuapp target, this image by default also includes the :ref:`provisioning_image_net_core` sample as a child image for the network core (``nrf5340dk/nrf5340/cpunet`` target).
1717
The child image demonstrates how to disable the debugging access on the network core by writing to the UICR.APPROTECT register.
@@ -34,7 +34,7 @@ The sample also requires the following libraries to generate and store the maste
3434
Overview
3535
********
3636

37-
The PSA security model defines the PRoT security lifecycle states.
37+
The Platform Security Architecture (PSA) security model defines the PRoT security lifecycle states.
3838
This sample performs the transition from the PRoT security lifecycle state **Device Assembly and Test** to the **PRoT Provisioning** state.
3939

4040
PRoT Provisioning is a state where the device platform security parameters are generated.

0 commit comments

Comments
 (0)