Skip to content

boot_copy_region uses boot_encrypt before boot_enc_init if a swap is continued #2183

Open
@Olstyle

Description

@Olstyle

swap_run will reach down to boot_copy_region which always calls boot_encrypt for encrypted images, but the AES context is only initialized via boot_enc_load if a swap was NOT ongoing.
This effectively breaks swap continuation for encoded images if the used crypto library relies on initialization.
Which is the case for mbedtls_aes_init and will pretty much always be the case for HW based implementations.

The following screenshots show my HW implementation failing, but according to my review, mbedtls will fail at the same point!

Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoEncryption support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions