Skip to content

Commit 44a935e

Browse files
taltenbachutzig
authored andcommitted
docs: Update documentation regarding encrypted scratch area
When using swap using scratch, the decryption now happens when copying from the scratch area to the primary slot, which means the image is stored encrypted in the scratch area. This commit updates the documentation accordingly. Signed-off-by: Thomas Altenbach <[email protected]>
1 parent 08d2d94 commit 44a935e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/encrypted_images.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,14 @@ start the validation process, decrypting the blocks before check. A good
120120
image being determined, the upgrade consists in reading the blocks from
121121
the `secondary slot`, decrypting and writing to the `primary slot`.
122122

123-
If swap is used for the upgrade process, the encryption happens when
124-
copying the sectors of the `secondary slot` to the scratch area.
125-
126-
The `scratch` area is not encrypted, so it must reside in the internal
127-
flash of the MCU to avoid attacks that could interrupt the upgrade and
128-
dump the data.
123+
If swap using scratch is used for the upgrade process, the decryption happens
124+
when copying the content of the scratch area to the `primary slot`, which means
125+
the scratch area does not contain the image unencrypted. However, unless
126+
`MCUBOOT_SWAP_SAVE_ENCTLV` is enabled, the decryption keys are stored in
127+
plaintext in the scratch area. Therefore, `MCUBOOT_SWAP_SAVE_ENCTLV` must be
128+
enabled if the scratch area does not reside in the internal flash memory of the
129+
MCU, to avoid attacks that could interrupt the upgrade and read the plaintext
130+
decryption keys from external flash memory.
129131

130132
Also when swap is used, the image in the `primary slot` is checked for
131133
presence of the `ENCRYPTED` flag and the key TLV. If those are present the

0 commit comments

Comments
 (0)