You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/security/secure-boot-v2.rst
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -435,30 +435,39 @@ Restrictions After Secure Boot Is Enabled
435
435
436
436
- 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.
437
437
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
+
438
440
Burning read-protected keys
439
441
~~~~~~~~~~~~~~~~~~~~~~~~~~~
440
442
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):
446
445
447
446
.. list::
448
-
:SOC_FLASH_ENC_SUPPORTED:* the flash encryption key
447
+
448
+
:SOC_FLASH_ENC_SUPPORTED:* Flash encryption key
449
449
450
450
:SOC_HMAC_SUPPORTED:* HMAC keys
451
451
452
452
:SOC_ECDSA_SUPPORTED:* ECDSA keys
453
453
454
454
:SOC_KEY_MANAGER_SUPPORTED:* Key Manager keys
455
455
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):
457
458
458
-
It is highly recommended that all such keys must been burned before enabling secure boot.
459
+
.. list::
459
460
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::
461
469
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.
462
471
463
472
.. _secure-boot-v2-generate-key:
464
473
@@ -631,7 +640,7 @@ Secure Boot Best Practices
631
640
4. The active partition is set to the new OTA application's partition.
632
641
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.
633
642
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.
635
644
636
645
* 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.
0 commit comments