sysbuild with encryption fails as soon as SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_256=y is set

Hi

For a product, I'd like to have (well it's a requirement) the firmware update encrypted.
So I set the following in sysbuild.conf:
...
SB_CONFIG_BOOT_ENCRYPTION=y
SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_256=y
SB_CONFIG_BOOT_ENCRYPTION_KEY_FILE="PATH_TO/encryption-key.pem"
...

As I'like to use AES-256, I also set CONFIG_PSA_CRYPTO=y in mcuboot.conf as tinycrypt does only support AES-128.
Unfortunately the generating the signed_by_mcuboot_and_b0_ipc_radio.hex file now fiails with:

Usage: imgtool.py sign [OPTIONS] INFILE OUTFILE
Try 'imgtool.py sign --help' for help.

Error: Can not set rom_fixed and load_addr at the same time

surprisingly, using SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_128=y works

I use NCS-3.4.0

Parents
  • doing this change in the sdk-nrf repo:


    diff --git a/cmake/sysbuild/b0_mcuboot_signing.cmake b/cmake/sysbuild/b0_mcuboot_signing.cmake
    index 438caf840..72b2715be 100644
    --- a/cmake/sysbuild/b0_mcuboot_signing.cmake
    +++ b/cmake/sysbuild/b0_mcuboot_signing.cmake
    @@ -102,7 +102,7 @@ function(ncs_secure_boot_mcuboot_sign application bin_files signed_targets prefi
    if(NOT "${keyfile_enc}" STREQUAL "")
    if(SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_256)
    # Note: this overrides the default behavior of using AES-128
    - set(imgtool_extra ${imgtool_extra} --encrypt-keylen 256 --load-addr ${slot_address})
    + set(imgtool_extra ${imgtool_extra} --encrypt-keylen 256)
    endif()

    # Signature type determines key exchange scheme; ED25519 here means

    makes it compile. don't now yet if it also works as intended

Reply
  • doing this change in the sdk-nrf repo:


    diff --git a/cmake/sysbuild/b0_mcuboot_signing.cmake b/cmake/sysbuild/b0_mcuboot_signing.cmake
    index 438caf840..72b2715be 100644
    --- a/cmake/sysbuild/b0_mcuboot_signing.cmake
    +++ b/cmake/sysbuild/b0_mcuboot_signing.cmake
    @@ -102,7 +102,7 @@ function(ncs_secure_boot_mcuboot_sign application bin_files signed_targets prefi
    if(NOT "${keyfile_enc}" STREQUAL "")
    if(SB_CONFIG_BOOT_ENCRYPTION_ALG_AES_256)
    # Note: this overrides the default behavior of using AES-128
    - set(imgtool_extra ${imgtool_extra} --encrypt-keylen 256 --load-addr ${slot_address})
    + set(imgtool_extra ${imgtool_extra} --encrypt-keylen 256)
    endif()

    # Signature type determines key exchange scheme; ED25519 here means

    makes it compile. don't now yet if it also works as intended

Children
Related