mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-05 08:27:30 +00:00
According to the documentation[1][2] for partitions, setting the encrypted flag for partitions should be a no-op when system level encryption isn't enabled. The current implementation, however, does not actually match the documentation and it ends up with an unreadable partition via the partition API if a partition flag is marked as encrypted without system-level encryption enabled. (This is because the writes go through the encryption block, and reads do not go through the encryption block when this situation occurs causing unreadable data to the application running.) This fixes up the read-back of the partition table to match whether or not the partition is currently encrypted under the hood. This should not affect the bootloader's code for reading/writing encrypted partitions as the bootloader directly invokes the spi_flash_write*(...) APIs. [1] https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/partition-tables.html#flags [2] https://docs.espressif.com/projects/esp-idf/en/latest/security/flash-encryption.html#encrypted-partition-flag Closes https://github.com/espressif/esp-idf/pull/3328 Signed-off-by: Tim Nordell <tim.nordell@nimbelink.com>
12 KiB
12 KiB