Skip to content

Commit 58051ca

Browse files
Merge branch 'fix/secure_boot_documentation' into 'master'
fix(docs): Fix secure boot v2 documentation Closes IDFGH-13716 See merge request espressif/esp-idf!33594
2 parents 2f0dc01 + 2c11c2a commit 58051ca

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

docs/en/security/secure-boot-v2.rst

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -435,30 +435,39 @@ Restrictions After Secure Boot Is Enabled
435435

436436
- Please note that enabling Secure Boot or flash encryption disables the USB-OTG USB stack in the ROM, disallowing updates via the serial emulation or Device Firmware Update (DFU) on that port.
437437

438+
- After Secure Boot is enabled, further read-protection of eFuse keys is not possible. This is done to prevent an attacker from read-protecting the eFuse block that contains the Secure Boot public key digest, which could result in immediate denial of service and potentially enable a fault injection attack to bypass the signature verification. For further information on read-protected keys, see the details below.
439+
438440
Burning read-protected keys
439441
~~~~~~~~~~~~~~~~~~~~~~~~~~~
440442

441-
After Secure Boot is enabled, no further eFuses can be read-protected, because this might allow an attacker to read-protect the efuse block holding the public key digest, causing an immediate denial of service and possibly allowing an additional fault injection attack to bypass the signature protection.
442-
443-
If :doc:`/security/flash-encryption` is enabled by the 2nd stage bootloader, it ensures that the flash encryption key generated on the first boot shall already be read-protected.
444-
445-
In case you need to read-protect a key after Secure Boot has been enabled on the device, for example,
443+
**Read protected keys**:
444+
The following keys must be read-protected on the device, the respective hardware will have access them directly (not readable by software):
446445

447446
.. list::
448-
:SOC_FLASH_ENC_SUPPORTED:* the flash encryption key
447+
448+
:SOC_FLASH_ENC_SUPPORTED:* Flash encryption key
449449

450450
:SOC_HMAC_SUPPORTED:* HMAC keys
451451

452452
:SOC_ECDSA_SUPPORTED:* ECDSA keys
453453

454454
:SOC_KEY_MANAGER_SUPPORTED:* Key Manager keys
455455

456-
you need to enable the config :ref:`CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS` at the same time when you enable Secure Boot to prevent disabling the ability to read-protect further efuses.
456+
**Non-read protected keys**:
457+
The following keys must not be read-protected on the device as the software needs to access them (readable by software):
457458

458-
It is highly recommended that all such keys must been burned before enabling secure boot.
459+
.. list::
459460

460-
In case you need to enable :ref:`CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS`, make sure that you burn the efuse {IDF_TARGET_EFUSE_WR_DIS_RD_DIS}, using ``esp_efuse_write_field_bit()`` API from ``esp_efuse.h``, once all the read-protected efuse keys have been programmed.
461+
:SOC_SECURE_BOOT_SUPPORTED:* Secure boot public key digest
462+
* User data
463+
464+
When Secure Boot is enabled, it shall disable the ability to read-protect further eFuses by default. If you want keep the ability to read-protect an eFuse later in the application (e.g, a key mentioned in the above list of read-protected keys) then you need to enable the config :ref:`CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS` at the same time when you enable Secure Boot.
465+
466+
Ideally, it is strongly recommended that all such keys must been burned before enabling secure boot. However, if you need to enable :ref:`CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS`, make sure that you burn the eFuse {IDF_TARGET_EFUSE_WR_DIS_RD_DIS}, using :cpp:func:`esp_efuse_write_field_bit`, once all the read-protected eFuse keys have been programmed.
467+
468+
.. note::
461469

470+
If :doc:`/security/flash-encryption` is enabled by the 2nd stage bootloader at the time of enabling Secure Boot, it ensures that the flash encryption key generated on the first boot shall already be read-protected.
462471

463472
.. _secure-boot-v2-generate-key:
464473

@@ -631,7 +640,7 @@ Secure Boot Best Practices
631640
4. The active partition is set to the new OTA application's partition.
632641
5. The device resets and loads the bootloader that is verified with key #N-1, which then boots the new app verified with key #N.
633642
6. The new app verifies the bootloader with key #N as a final check, and then runs code to revoke key #N-1, i.e., sets KEY_REVOKE eFuse bit.
634-
7. The API `esp_ota_revoke_secure_boot_public_key()` can be used to revoke the key #N-1.
643+
7. The API :cpp:func:`esp_ota_revoke_secure_boot_public_key` can be used to revoke the key #N-1.
635644

636645
* A similar approach can also be used to physically re-flash with a new key. For physical re-flashing, the bootloader content can also be changed at the same time.
637646

0 commit comments

Comments
 (0)