Skip to content

Commit 4e082ef

Browse files
committed
Merge branch 'fix/change_write_protection_bit_of_shared_security_efuses' into 'master'
Reorder write protection bits of some shared security efuses See merge request espressif/esp-idf!41619
2 parents e8ec954 + 71f8405 commit 4e082ef

File tree

12 files changed

+106
-36
lines changed

12 files changed

+106
-36
lines changed

components/bootloader/Kconfig.projbuild

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,24 @@ menu "Security features"
972972
so that the bootloader would not need to enable secure boot and thus you could avoid its revocation
973973
strategy.
974974

975+
config SECURE_BOOT_SKIP_WRITE_PROTECTION_SCA
976+
bool "Skip write-protection of SECURE_FLASH_PSEUDO_ROUND_FUNC_STRENGTH"
977+
default y if SECURE_FLASH_PSEUDO_ROUND_FUNC
978+
default n
979+
depends on SOC_ECDSA_SUPPORT_CURVE_P384 && SOC_FLASH_ENCRYPTION_XTS_AES_SUPPORT_PSEUDO_ROUND
980+
help
981+
If not set (default, recommended), on the first boot when Secure Boot is enabled for
982+
targets that support Secure Boot using ECDSA-P384, the bootloader will burn the write-protection bit of
983+
of SECURE_BOOT_SHA384_EN that could be shared by multiple other efuse bits like
984+
SECURE_FLASH_PSEUDO_ROUND_FUNC_STRENGTH / XTS_DPA_PSEUDO_LEVEL.
985+
986+
Once this efuse bit is write-protected you cannot update the values of the shared efuses, for example,
987+
the security strength value of XTS_DPA_PSEUDO_LEVEL or setting ECC_FORCE_CONST_TIME.
988+
989+
List of eFuses with the same write protection bit:
990+
991+
ESP32-C5: XTS_DPA_PSEUDO_LEVEL and ECC_FORCE_CONST_TIME
992+
975993
config SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC
976994
bool "Leave UART bootloader encryption enabled"
977995
depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
@@ -1055,6 +1073,7 @@ menu "Security features"
10551073
ESP32-S3: DIS_ICACHE, DIS_DCACHE, DIS_DOWNLOAD_ICACHE, DIS_DOWNLOAD_DCACHE,
10561074
DIS_FORCE_DOWNLOAD, DIS_USB_OTG, DIS_TWAI, DIS_APP_CPU, DIS_PAD_JTAG,
10571075
DIS_DOWNLOAD_MANUAL_ENCRYPT, DIS_USB_JTAG, DIS_USB_SERIAL_JTAG, STRAP_JTAG_SEL, USB_PHY_SEL.
1076+
10581077
endmenu # Potentially Insecure
10591078

10601079
config SECURE_FLASH_ENCRYPT_ONLY_IMAGE_LEN_IN_APP_PART
@@ -1101,6 +1120,12 @@ menu "Security features"
11011120
The strength of the pseudo rounds functions can be configured to low, medium and high,
11021121
each denoting the values that would be stored in the efuses field.
11031122
By default the value to set to low.
1123+
1124+
It is recommended that the required strength of the pseudo rounds function should be set during the
1125+
first boot itself. If your workflow needs to update the function's strength after the first boot,
1126+
you should enable CONFIG_SECURE_BOOT_SKIP_WRITE_PROTECTION_SCA to avoid write protecting this
1127+
bit during the boot up for targets that support Secure Boot using ECDSA-P384.
1128+
11041129
You can configure the strength of the pseudo rounds functions according to your use cases,
11051130
for example, increasing the strength would provide higher security but would slow down the
11061131
flash encryption/decryption operations.

components/bootloader_support/src/esp32c5/secure_boot_secure_features.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
5353
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_SHA384_EN);
5454
#endif
5555

56-
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_SECURE_BOOT_SHA384_EN);
57-
5856
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
5957

6058
#ifndef CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS

components/bootloader_support/src/esp32h2/secure_boot_secure_features.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
3737
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
3838
#endif
3939

40-
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
41-
if (ecdsa_ll_is_configurable_curve_supported()) {
42-
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
43-
}
44-
#endif
45-
4640
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
4741
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
4842
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);

components/bootloader_support/src/esp32h21/secure_boot_secure_features.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
3636
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
3737
#endif
3838

39-
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
40-
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
41-
#endif
42-
4339
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
4440
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
4541
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);

components/bootloader_support/src/secure_boot.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,13 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
429429
}
430430

431431
#if SOC_ECDSA_SUPPORT_CURVE_P384
432+
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
433+
secure = esp_efuse_read_field_bit(ESP_EFUSE_SECURE_BOOT_SHA384_EN);
434+
result &= secure;
435+
if (!secure) {
436+
ESP_LOGW(TAG, "Not enabled Secure Boot using SHA-384 mode (set SECURE_BOOT_SHA384_EN->1)");
437+
}
438+
#else
432439
/* When using Secure Boot with SHA-384, the efuse bit representing Secure Boot with SHA-384 would already be programmed.
433440
* But in the case of the existing Secure Boot V2 schemes using SHA-256, the efuse bit representing
434441
* Secure Boot with SHA-384 needs to be write-protected, so that an attacker cannot perform a denial-of-service
@@ -439,6 +446,7 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
439446
if (!secure) {
440447
ESP_LOGW(TAG, "Not write-protected secure boot using SHA-384 mode (set WR_DIS_SECURE_BOOT_SHA384_EN->1)");
441448
}
449+
#endif
442450
#endif
443451

444452
secure = (num_keys != 0);

components/esp_security/Kconfig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ menu "ESP Security Specific"
4040
config ESP_CRYPTO_FORCE_ECC_CONSTANT_TIME_POINT_MUL
4141
bool "Forcefully enable ECC constant time point multiplication operations"
4242
depends on SOC_ECC_CONSTANT_TIME_POINT_MUL
43-
default N
43+
default n
4444
help
4545
If enabled, the app startup code will burn the ECC_FORCE_CONST_TIME efuse bit to force the
4646
ECC peripheral to always perform constant time point multiplication operations,
@@ -51,10 +51,16 @@ menu "ESP Security Specific"
5151
time point multiplication operations by changing the default ESP-IDF configurations.
5252
Performing constant time operations protect the ECC multiplication operations from timing attacks.
5353

54+
For targets that support Secure Boot using ECDSA-P384, the write-protection bit of the efuse
55+
bit could be shared by multiple other efuse bits and can be programmed by the application when
56+
Secure Boot is enabled.
57+
Thus, you could select CONFIG_SECURE_BOOT_SKIP_WRITE_PROTECTION_SCA, in case you would like
58+
to skip the write-protection of the efuse bit.
59+
5460
config ESP_ECDSA_ENABLE_P192_CURVE
5561
bool "Enable ECDSA 192-curve operations"
5662
depends on SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
57-
default N
63+
default n
5864
help
5965
By default, only the 256-bit curve operations are allowed. If this configuration is enabled,
6066
it will set the eFuse to allow ECDSA operations using both the 192-bit and 256-bit curves.

components/esp_security/src/init.c

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include "hal/key_mgr_ll.h"
2323
#endif /* SOC_KEY_MANAGER_SUPPORT_KEY_DEPLOYMENT */
2424

25+
#if SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
26+
#include "hal/ecdsa_ll.h"
27+
#endif /* SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED */
28+
2529
__attribute__((unused)) static const char *TAG = "esp_security";
2630

2731
static void esp_key_mgr_init(void)
@@ -46,6 +50,8 @@ ESP_SYSTEM_INIT_FN(esp_security_init, SECONDARY, BIT(0), 103)
4650
esp_crypto_dpa_protection_startup();
4751
#endif
4852

53+
esp_err_t err = ESP_FAIL;
54+
4955
#if CONFIG_ESP_CRYPTO_FORCE_ECC_CONSTANT_TIME_POINT_MUL
5056
bool force_constant_time = true;
5157
#if CONFIG_IDF_TARGET_ESP32H2
@@ -55,7 +61,7 @@ ESP_SYSTEM_INIT_FN(esp_security_init, SECONDARY, BIT(0), 103)
5561
#endif
5662
if (!esp_efuse_read_field_bit(ESP_EFUSE_ECC_FORCE_CONST_TIME) && force_constant_time) {
5763
ESP_EARLY_LOGD(TAG, "Forcefully enabling ECC constant time operations");
58-
esp_err_t err = esp_efuse_write_field_bit(ESP_EFUSE_ECC_FORCE_CONST_TIME);
64+
err = esp_efuse_write_field_bit(ESP_EFUSE_ECC_FORCE_CONST_TIME);
5965
if (err != ESP_OK) {
6066
ESP_EARLY_LOGE(TAG, "Enabling ECC constant time operations forcefully failed.");
6167
return err;
@@ -64,13 +70,42 @@ ESP_SYSTEM_INIT_FN(esp_security_init, SECONDARY, BIT(0), 103)
6470
#endif
6571

6672
#if CONFIG_ESP_ECDSA_ENABLE_P192_CURVE
67-
esp_err_t err = esp_efuse_enable_ecdsa_p192_curve_mode();
73+
err = esp_efuse_enable_ecdsa_p192_curve_mode();
6874
if (err != ESP_OK) {
6975
return err;
7076
}
7177
#endif
7278

73-
return ESP_OK;
79+
#if CONFIG_SECURE_BOOT_V2_ENABLED
80+
// H2, H21
81+
#if SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
82+
// Also write protects the ECDSA_CURVE_MODE efuse bit.
83+
if (ecdsa_ll_is_configurable_curve_supported()) {
84+
err = esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
85+
if (err != ESP_OK) {
86+
ESP_LOGE(TAG, "Failed to write protect the ECDSA_CURVE_MODE efuse bit.");
87+
return err;
88+
}
89+
}
90+
#endif
91+
92+
#if !CONFIG_SECURE_BOOT_SKIP_WRITE_PROTECTION_SCA
93+
// C5
94+
#if SOC_ECDSA_SUPPORT_CURVE_P384 && !CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
95+
// Since SECURE_BOOT_SHA384_EN, XTS_DPA_PSEUDO_LEVEL, and ECC_FORCE_CONST_TIME share the
96+
// same write-protection bit, these efuses should only be write-protected after all of
97+
// them have been programmed.
98+
err = esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_SECURE_BOOT_SHA384_EN);
99+
if (err != ESP_OK) {
100+
ESP_LOGE(TAG, "Failed to write protect the SECURE_BOOT_SHA384_EN efuse bit.");
101+
return err;
102+
}
103+
#endif
104+
#endif
105+
#endif
106+
107+
err = ESP_OK;
108+
return err;
74109
}
75110

76111
void esp_security_init_include_impl(void)

docs/en/security/flash-encryption.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,10 @@ It is recommended to use flash encryption in combination with Secure Boot. Howev
876876

877877
- :ref:`Re-flashing via Pregenerated Flash Encryption Key <pregenerated-flash-encryption-key>` is still possible, provided the bootloader is not re-flashed. Re-flashing the bootloader requires the same :ref:`Re-flashable <CONFIG_SECURE_BOOTLOADER_MODE>` option to be enabled in the Secure Boot config.
878878

879+
.. only:: SOC_FLASH_ENCRYPTION_XTS_AES_SUPPORT_PSEUDO_ROUND and SOC_ECDSA_SUPPORT_CURVE_P384
880+
881+
- It is recommended that the required strength of the :ref:`xts-aes-pseudo-round-func` should be set during the first boot when flash encryption release mode is enabled. If your workflow needs to update the function's strength after the first boot, you should enable :ref:`CONFIG_SECURE_BOOT_SKIP_WRITE_PROTECTION_SCA` to avoid write-protecting this bit during boot.
882+
879883
.. _flash-encryption-advanced-features:
880884

881885
Advanced Features

docs/en/security/security-features-enablement-workflows.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ In this workflow we shall use ``espsecure`` tool to generate signing keys and us
500500
:SOC_EFUSE_DIS_USB_JTAG: - ``DIS_USB_JTAG``: Disable USB switch to JTAG.
501501
:SOC_EFUSE_DIS_PAD_JTAG: - ``DIS_PAD_JTAG``: Disable JTAG permanently.
502502
:SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS: - ``SECURE_BOOT_AGGRESSIVE_REVOKE``: Aggressive revocation of key digests, see :ref:`secure-boot-v2-aggressive-key-revocation` for more details.
503-
:SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED: - ``WR_DIS_ECDSA_CURVE_MODE``: Disable writing to the ECDSA curve mode eFuse bit.
504-
:SOC_ECDSA_SUPPORT_CURVE_P384: - ``WR_DIS_SECURE_BOOT_SHA384_EN``: Disable writing to the SHA-384 secure boot eFuse bit.
503+
:SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED: - ``WR_DIS_ECDSA_CURVE_MODE``: Disable writing to the ECDSA curve mode eFuse bit. As this write protection bit is shared with ``ECC_FORCE_CONST_TIME``, it is recommended to write protect this bit only after configuring the ``ECC_FORCE_CONST_TIME`` eFuse.
504+
:SOC_ECDSA_SUPPORT_CURVE_P384: - ``WR_DIS_SECURE_BOOT_SHA384_EN``: Disable writing to the SHA-384 Secure Boot eFuse bit. As this write protection bit is shared with ``XTS_DPA_PSEUDO_LEVEL`` and ``ECC_FORCE_CONST_TIME``, it is recommended to write protect this bit only after configuring all the other shared eFuses.
505505

506506
The respective eFuses can be burned by running:
507507

docs/zh_CN/security/flash-encryption.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ flash 加密设置
490490

491491
如果使用开发模式,那么更新和重新烧录二进制文件最简单的方法是 :ref:`encrypt-partitions`。
492492

493-
如果使用发布模式,那么可以在主机上预先加密二进制文件,然后将其作为密文烧录。具体请参考 :ref:`manual-encryption`。
493+
如果使用量产模式,那么可以在主机上预先加密二进制文件,然后将其作为密文烧录。具体请参考 :ref:`manual-encryption`。
494494

495495

496496
.. _encrypt-partitions:
@@ -513,10 +513,10 @@ flash 加密设置
513513
514514
.. _flash-enc-release-mode:
515515

516-
发布模式
516+
量产模式
517517
^^^^^^^^^^
518518

519-
在发布模式下,UART 引导加载程序无法执行 flash 加密操作,**只能** 使用 OTA 方案下载新的明文镜像,该方案将在写入 flash 前加密明文镜像。
519+
在量产模式下,UART 引导加载程序无法执行 flash 加密操作,**只能** 使用 OTA 方案下载新的明文镜像,该方案将在写入 flash 前加密明文镜像。
520520

521521
使用该模式需要执行以下步骤:
522522

@@ -529,9 +529,9 @@ flash 加密设置
529529
.. list::
530530

531531
- :ref:`启动时使能 flash 加密 <CONFIG_SECURE_FLASH_ENC_ENABLED>`。
532-
:esp32: - :ref:`选择发布模式 <CONFIG_SECURE_FLASH_ENCRYPTION_MODE>`。(注意一旦选择了发布模式,``DISABLE_DL_ENCRYPT`` 和 ``DISABLE_DL_DECRYPT`` eFuse 位将被编程为在 ROM 下载模式下禁用 flash 加密硬件)
532+
:esp32: - :ref:`选择量产模式 <CONFIG_SECURE_FLASH_ENCRYPTION_MODE>`。(注意一旦选择了量产模式,``DISABLE_DL_ENCRYPT`` 和 ``DISABLE_DL_DECRYPT`` eFuse 位将被编程为在 ROM 下载模式下禁用 flash 加密硬件)
533533
:esp32: - :ref:`选择 UART ROM 下载模式(推荐永久性禁用)<CONFIG_SECURE_UART_ROM_DL_MODE>` (注意该选项仅在 :ref:`CONFIG_ESP32_REV_MIN` 级别设置为 3 时 (ESP32 V3) 可用。)默认选项是保持启用 UART ROM 下载模式,然而建议永久禁用该模式,以减少攻击者可用的选项。
534-
:not esp32: - :ref:`选择发布模式 <CONFIG_SECURE_FLASH_ENCRYPTION_MODE>`。(注意一旦选择了发布模式,``EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT`` eFuse 位将被编程为在 ROM 下载模式下禁用 flash 加密硬件)
534+
:not esp32: - :ref:`选择量产模式 <CONFIG_SECURE_FLASH_ENCRYPTION_MODE>`。(注意一旦选择了量产模式,``EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT`` eFuse 位将被编程为在 ROM 下载模式下禁用 flash 加密硬件)
535535
:not esp32: - :ref:`选择 UART ROM 下载(推荐永久性的切换到安全模式)<CONFIG_SECURE_UART_ROM_DL_MODE>`。这是默认且推荐使用的选项。如果不需要该模式,也可以改变此配置设置永久地禁用 UART ROM 下载模式。
536536
:SOC_FLASH_ENCRYPTION_XTS_AES_SUPPORT_PSEUDO_ROUND: - :ref:`启用 XTS-AES 伪轮次功能 <CONFIG_SECURE_FLASH_PSEUDO_ROUND_FUNC>`。该选项已默认启用,且配置为最低强度等级,以降低对 flash 加密/解密操作的性能影响。如需了解每个安全等级对性能影响的更多信息,请参考 :ref:`xts-aes-pseudo-round-func`。
537537
- :ref:`选择适当详细程度的引导加载程序日志级别 <CONFIG_BOOTLOADER_LOG_LEVEL>`。
@@ -552,7 +552,7 @@ flash 加密设置
552552

553553
该命令将向 flash 写入未加密的镜像:二级引导加载程序、分区表和应用程序。烧录完成后,{IDF_TARGET_NAME} 将复位。在下一次启动时,二级引导加载程序会加密:二级引导加载程序、应用程序分区和标记为 ``加密`` 的分区,然后复位。就地加密可能需要时间,对于大的分区来说可能耗时一分钟。之后,应用程序在运行时被解密并执行。
554554

555-
一旦在发布模式下启用 flash 加密,引导加载程序将写保护 ``{IDF_TARGET_CRYPT_CNT}`` eFuse。
555+
一旦在量产模式下启用 flash 加密,引导加载程序将写保护 ``{IDF_TARGET_CRYPT_CNT}`` eFuse。
556556

557557
请使用 :ref:`OTA 方案 <updating-encrypted-flash-ota>` 对字段中的明文进行后续更新。
558558

@@ -571,7 +571,7 @@ flash 加密设置
571571

572572
- 不要在多个设备之间重复使用同一个 flash 加密密钥,这样攻击者就无法从一台设备上复制加密数据后再将其转移到第二台设备上。
573573
:esp32: - 在使用 ESP32 V3 时,如果生产设备不需要 UART ROM 下载模式,那么则该禁用该模式以增加设备安全性。这可以通过在应用程序启动时调用 :cpp:func:`esp_efuse_disable_rom_download_mode` 来实现。或者,可将项目 :ref:`CONFIG_ESP32_REV_MIN` 级别配置为 3(仅针对 ESP32 V3),然后选择 :ref:`CONFIG_SECURE_UART_ROM_DL_MODE` 为“永久性的禁用 ROM 下载模式(推荐)”。在早期的 ESP32 版本上无法禁用 ROM 下载模式。
574-
:not esp32: - 如果不需要 UART ROM 下载模式,则应完全禁用该模式,或者永久设置为“安全下载模式”。安全下载模式永久性地将可用的命令限制在更新 SPI 配置、更改波特率、基本的 flash 写入和使用 `get_security_info` 命令返回当前启用的安全功能摘要。默认在发布模式下第一次启动时设置为安全下载模式。要完全禁用下载模式,请选择 :ref:`CONFIG_SECURE_UART_ROM_DL_MODE` 为“永久禁用 ROM 下载模式(推荐)”或在运行时调用 :cpp:func:`esp_efuse_disable_rom_download_mode`。
574+
:not esp32: - 如果不需要 UART ROM 下载模式,则应完全禁用该模式,或者永久设置为“安全下载模式”。安全下载模式永久性地将可用的命令限制在更新 SPI 配置、更改波特率、基本的 flash 写入和使用 `get_security_info` 命令返回当前启用的安全功能摘要。默认在量产模式下第一次启动时设置为安全下载模式。要完全禁用下载模式,请选择 :ref:`CONFIG_SECURE_UART_ROM_DL_MODE` 为“永久禁用 ROM 下载模式(推荐)”或在运行时调用 :cpp:func:`esp_efuse_disable_rom_download_mode`。
575575
- 启用 :doc:`安全启动<secure-boot-v2>` 作为额外的保护层,防止攻击者在启动前有选择地破坏 flash 中某部分。
576576

577577
外部启用 flash 加密
@@ -789,7 +789,7 @@ OTA 更新
789789

790790
在开发模式下,推荐的方法是 :ref:`encrypt-partitions`。
791791

792-
在发布模式下,如果主机上有存储在 eFuse 中的相同密钥的副本,那么就可以在主机上对文件进行预加密,然后进行烧录,具体请参考 :ref:`manual-encryption`。
792+
在量产模式下,如果主机上有存储在 eFuse 中的相同密钥的副本,那么就可以在主机上对文件进行预加密,然后进行烧录,具体请参考 :ref:`manual-encryption`。
793793

794794
关闭 flash 加密
795795
-----------------
@@ -876,6 +876,10 @@ flash 加密与安全启动
876876

877877
- 如果未重新烧录引导加载程序,则仍然可以 :ref:`使用预生成的 flash 加密密钥重新烧录 <pregenerated-flash-encryption-key>`。重新烧录引导加载程序时,需在安全启动配置中启用相同的 :ref:`可重新烧录 <CONFIG_SECURE_BOOTLOADER_MODE>` 选项。
878878

879+
.. only:: SOC_FLASH_ENCRYPTION_XTS_AES_SUPPORT_PSEUDO_ROUND and SOC_ECDSA_SUPPORT_CURVE_P384
880+
881+
- 在启用 flash 加密量产模式时,建议在首次启动时就设置 :ref:`xts-aes-pseudo-round-func` 所需的强度。如果你的工作流程需要在首次启动后更新该函数的强度,则应启用 :ref:`CONFIG_SECURE_BOOT_SKIP_WRITE_PROTECTION_SCA`,避免在启动过程中对该位进行写保护。
882+
879883
.. _flash-encryption-without-secure-boot:
880884

881885
flash 加密的高级功能
@@ -986,7 +990,7 @@ flash 加密的高级功能
986990
JTAG 调试
987991
^^^^^^^^^^^^^^
988992

989-
默认情况下,当启用 flash 加密(开发或发布模式)时,将通过 eFuse 禁用 JTAG 调试。引导加载程序在首次启动时执行此操作,同时启用 flash 加密。
993+
默认情况下,当启用 flash 加密(开发或量产模式)时,将通过 eFuse 禁用 JTAG 调试。引导加载程序在首次启动时执行此操作,同时启用 flash 加密。
990994

991995
请参考 :ref:`jtag-debugging-security-features` 了解更多关于使用 JTAG 调试与 flash 加密的信息。
992996

0 commit comments

Comments
 (0)