flash encryption: Add config option to disable any plaintext reflashes

Enabled by default when Secure Boot is on, so Flash Encryption protection
is always available in case of a Secure Boot bypass.
This commit is contained in:
Angus Gratton
2019-06-12 11:03:42 +10:00
committed by bot
parent 70ecb7ec94
commit e8a4e70c42
4 changed files with 67 additions and 15 deletions

View File

@@ -69,6 +69,7 @@
#include "esp_clk_internal.h"
#include "esp_timer.h"
#include "esp_pm.h"
#include "esp_flash_encrypt.h"
#include "pm_impl.h"
#include "trax.h"
#include "esp_ota_ops.h"
@@ -347,6 +348,11 @@ void start_cpu0_default(void)
#endif
#if CONFIG_DISABLE_BASIC_ROM_CONSOLE
esp_efuse_disable_basic_rom_console();
#endif
#ifdef CONFIG_FLASH_ENCRYPTION_DISABLE_PLAINTEXT
if (esp_flash_encryption_enabled()) {
esp_flash_write_protect_crypt_cnt();
}
#endif
rtc_gpio_force_hold_dis_all();
esp_vfs_dev_uart_register();