From 93512edc7adf0e897337a1b644acedc6f483e29c Mon Sep 17 00:00:00 2001 From: KonstantinKondrashov Date: Mon, 2 Aug 2021 18:55:40 +0500 Subject: [PATCH] secure_boot_v2(doc): secure_boot_v2 key/s must be readable --- components/esptool_py/esptool | 2 +- docs/en/security/secure-boot-v2.rst | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/esptool_py/esptool b/components/esptool_py/esptool index e39896e124..9876dfe583 160000 --- a/components/esptool_py/esptool +++ b/components/esptool_py/esptool @@ -1 +1 @@ -Subproject commit e39896e1243418c7e28e4e0c4532661f3c7c5d2d +Subproject commit 9876dfe58353f01c873e1543dd0654c5b04314a4 diff --git a/docs/en/security/secure-boot-v2.rst b/docs/en/security/secure-boot-v2.rst index 222f3ba109..99b37261f3 100644 --- a/docs/en/security/secure-boot-v2.rst +++ b/docs/en/security/secure-boot-v2.rst @@ -36,11 +36,11 @@ Advantages - The RSA public key is stored on the device. The corresponding RSA private key is kept secret on a server and is never accessed by the device. - .. only:: esp32 +.. only:: esp32 - Only one public key can be generated and stored in ESP32 ECO3 during manufacturing. - .. only:: esp32s2 or esp32c3 +.. only:: esp32s2 or esp32c3 - Up to three public keys can be generated and stored in the chip during manufacturing. @@ -152,15 +152,15 @@ eFuse usage - ABS_DONE_1 - Enables secure boot protection on boot. - - BLK2 - Stores the SHA-256 digest of the public key. SHA-256 hash of public key modulus, exponent, precalculated R & M’ values (represented as 776 bytes – offsets 36 to 812 - as per the :ref:`signature-block-format`) is written to an eFuse key block. + - BLK2 - Stores the SHA-256 digest of the public key. SHA-256 hash of public key modulus, exponent, precalculated R & M’ values (represented as 776 bytes – offsets 36 to 812 - as per the :ref:`signature-block-format`) is written to an eFuse key block. The write-protection bit must be set, but the read-protection bit must not. .. only:: esp32s2 or esp32c3 - SECURE_BOOT_EN - Enables secure boot protection on boot. - - KEY_PURPOSE_X - Set the purpose of the key block on {IDF_TARGET_NAME} by programming SECURE_BOOT_DIGESTX (X = 0, 1, 2) into KEY_PURPOSE_X (X = 0, 1, 2, 3, 4, 5). Example: If KEY_PURPOSE_2 is set to SECURE_BOOT_DIGEST1, then BLOCK_KEY2 will have the Secure Boot V2 public key digest. + - KEY_PURPOSE_X - Set the purpose of the key block on {IDF_TARGET_NAME} by programming SECURE_BOOT_DIGESTX (X = 0, 1, 2) into KEY_PURPOSE_X (X = 0, 1, 2, 3, 4, 5). Example: If KEY_PURPOSE_2 is set to SECURE_BOOT_DIGEST1, then BLOCK_KEY2 will have the Secure Boot V2 public key digest. The write-protection bit must be set (this field does not have a read-protection bit). - - BLOCK_KEYX - The block contains the data corresponding to its purpose programmed in KEY_PURPOSE_X. Stores the SHA-256 digest of the public key. SHA-256 hash of public key modulus, exponent, precalculated R & M’ values (represented as 776 bytes – offsets 36 to 812 - as per the :ref:`signature-block-format`) is written to an eFuse key block. + - BLOCK_KEYX - The block contains the data corresponding to its purpose programmed in KEY_PURPOSE_X. Stores the SHA-256 digest of the public key. SHA-256 hash of public key modulus, exponent, precalculated R & M’ values (represented as 776 bytes – offsets 36 to 812 - as per the :ref:`signature-block-format`) is written to an eFuse key block. The write-protection bit must be set, but the read-protection bit must not. - KEY_REVOKEX - The revocation bits corresponding to each of the 3 key block. Ex. Setting KEY_REVOKE2 revokes the key block whose key purpose is SECURE_BOOT_DIGEST2. @@ -168,6 +168,8 @@ eFuse usage To ensure no trusted keys can be added later by an attacker, each unused key digest slot should be revoked (KEY_REVOKEX). It will be checked during app startup in :cpp:func:`esp_secure_boot_init_checks` and fixed unless :ref:`CONFIG_SECURE_BOOT_ALLOW_UNUSED_DIGEST_SLOTS` is enabled. +The key(s) must be readable in order to give software access to it. If the key(s) is read-protected then the software reads the key(s) as all zeros and the signature verification process occurs with error, bootloader and app can not be run. + .. _secure-boot-v2-howto: How To Enable Secure Boot V2