Commit Graph

2351 Commits

Author SHA1 Message Date
Fabio Utzig 4619da5660 ci: Fix FIH Docker image release usage
The scripts for fih tests install and run where running different
versions of the docker images, since the install specified a version and
not version was specified for run, defaulting to `latest`.

This commits adds a new file for specifying the docker image to be used.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2024-09-04 19:08:56 -03:00
Fabio Utzig a6ae770df6 ci: Update FIH docker to Ubuntu Jammy (22.04)
- Ubuntu Jammy brings CMake 3.22.1 required by newer TFM builds.
- Python requirements were updated following requirements in TFM.
- Added git configuration to ignore repo ownership checks (since 2.35.3).

Signed-off-by: Fabio Utzig <utzig@apache.org>
2024-09-04 19:08:56 -03:00
Jamie McCrae 242db1a930 boot: zephyr: boards: Add nrf54l15dk configuration
Adds the configuration for this board

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-09-04 10:41:13 +01:00
Jamie McCrae 651775b550 boot: zephyr: board: Fix nrf54l15pdk Kconfig fragment
Fixes an issue with this file as it was wrongly disabling QSPI
NOR, which the hardware does not support, when it should have been
disabling SPI NOR

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-09-04 10:41:13 +01:00
Mahesh Mahadevan a3762626f8 boot: zephyr: MCXN947 currently only does not support swap mode
Update the configuration to remove swap mode support.
MCXN94x ROM Flash API supports writing of 128byes page.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-09-04 07:16:26 +01:00
Lluis Campos 52e2afc2f8 boot_serial: Fix `format` warning
By explicitly casting to unsigned int.

Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
2024-08-27 15:34:27 +01:00
Lluis Campos dd4d6541c8 boot_serial: Fix `incompatible-pointer-types` warning
The variable `rc` was declared as int and then implicitly casted to
`size_t` when passed to `base64_decode`, which on 64 bit architectures
is wrong.

Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
2024-08-27 15:34:27 +01:00
Jamie McCrae ebf60e03df docs: release-notes: Add note on changes
Adds release notes based on these changes

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 15:34:13 +01:00
Jamie McCrae 2931f9d71f booutil: swap_scratch: Do not check sectors with compression
When compression is used, it allows for the secondary slot to be
smaller than the primary slot, therefore do not ensure that the
number of sectors in each slot are the same

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 15:34:13 +01:00
Jamie McCrae feb9265f91 bootutil: loader: Add protected TLV size to image size check
The protected TLV section was not included in the size check of
if an image could fit into a slot, which means that it was
possible for file to be deemed as OK for storing but then failing
due to insufficient flash space during the update

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 15:34:13 +01:00
Jamie McCrae 4d85e29f3d bootutil: loader: Remove images with conflicting flags
Marks images as invalid if they have conflicting flags, e.g. more
than one type of LZMA compression or more than one type of
encryption

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 15:34:13 +01:00
Jamie McCrae 206c7e7496 bootutil: loader: Remove encrypted/compressed images without support
Checks if images have compressed or encrypted image flags and, if
so, and those options are not enabled in that MCUboot build, will
class the images as invalid and delete them (these images cannot
be used without support anyway)

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 15:34:13 +01:00
Jamie McCrae 0c1ddf7e23 zephyr: Add Kconfig for decompression
Adds a Kconfig allowing the decompression option to be selected

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 15:34:13 +01:00
Jamie McCrae 91d86b8a32 bootutil: Add compressed image flags and TLV
Adds some flags to indicate if the data of an image is compressed
(lzma1 and lzma2) and adds new TLVs for compressed images relating
to the hash, signature and size of the decompressed image data,
this allows the image to be validated before decompressing, then
validated after decompression to ensure an image is always valid
for a device

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 15:34:13 +01:00
Jamie McCrae bf13555d13 docs: release-notes: Add note on bootutil changes
Adds notes on the changed bootutil features

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 12:51:27 +01:00
Jamie McCrae 2939d30545 bootutil: loader: Verify image header before checking image
Changes the order of operations to validate the image header
before checking the image, it does not make sense to check the
image if the header itself is invalid

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 12:51:27 +01:00
Jamie McCrae dbb5c782fb bootutil: loader: Add state to boot_is_header_valid() function
Adds the state object to this function so it can be referenced

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-27 12:51:27 +01:00
David Vincze 6071ceb1d0 boot: Introduce the MCUBOOT_ENC_BUILTIN_KEY option
- Introduce the MCUBOOT_ENC_BUILTIN_KEY config option for controlling the
usage of builtin key-encryption keys and replacing the MCUBOOT_HW_KEY
option in the image encryption module to avoid ambiguity as the latter
mentioned option is meant for configuring the handling of the
image verification keys,
- Add encryption build configs to template file.

Change-Id: Ic633d2103fb4e56d9fafdabef1fbddc3244cb795
Signed-off-by: David Vincze <david.vincze@arm.com>
2024-08-21 11:46:29 +01:00
Jamie McCrae ab4fb3299a bootutil: Fix wrong definition of find_swap_count
Fixes where this function is defined, to prevent build failures
when building TF-M

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-21 11:46:15 +01:00
Mateusz Wielgos dc03055537 imgtool: Add --non-bootable flag
Defaults to false.

Signed-off-by: Mateusz Wielgos <mateusz.wielgos@emerson.com>
2024-08-21 10:24:36 +01:00
Yong Cong Sin aa1f95606e zephyr: prefix generated header path with `zephyr/`
Update the include path of generated headers.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-08-21 10:22:42 +01:00
Sylvio Alves 334d2c28f6 boot: main: avoid unused build warning
In case ESP32 SoC is used, *start will get
build warning as it is not used.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-08-21 10:20:02 +01:00
Marek Matej c87d41efc8 boot: zephyr: Fix included header
Rename the header file after upstream change.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-08-19 10:47:04 -03:00
Tiago Medicci 12906fdeff espressif: Update the references for using the new Espressif HAL
The new Espressif HAL is based on ESP-IDF v5.1.4.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2024-08-15 10:02:03 -03:00
Jamie McCrae 034f58cbf1 bootutil: Fix missing include
Fixes a missing include in the header

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-14 09:09:54 +02:00
Jamie McCrae 148c2c1662 docs: release-notes: Add note on new slot info command
Adds release notes on the addition of this feature

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-13 09:35:21 +01:00
Jamie McCrae e261b285a1 boot_serial: Add optional img mgmt slot info feature
Adds a minimal version of the slot info feature to serial recovery,
and enables it by default.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-13 09:35:21 +01:00
Jamie McCrae 2db0654bc2 docs: release-notes: Add notes on maximum app size changes
Adds release notes for these changes

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-13 07:49:14 +01:00
Jamie McCrae e2e1e945fa bootutil: Fix swap move max app size calculation
This calculation failed to take into consideration the additional
sector needed for the swap move part of the upgrade process

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-13 07:49:14 +01:00
Jamie McCrae 4f1ab9e763 bootutil: Add missing images to get maximum image size details
Adds support for getting the maximum image size of multiple images
and adding this data to the shared data area

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-13 07:49:14 +01:00
Jamie McCrae 4baa6d3243 docs: release-notes: Add note on zephyr auto max sectors
Adds a note about the new feature that has been added

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-13 07:48:59 +01:00
Jamie McCrae eaae6500a7 zephyr: Add support for automatically calculcating max sectors
Adds a feature that will calculate the maximum number of sectors
that are needed for a build. Can be disabled to revert back to
the old behaviour by disabling CONFIG_BOOT_MAX_IMG_SECTORS_AUTO

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-08-13 07:48:59 +01:00
Dominik Ermel 6fe259b1b6 boot: Simplify copy loop in boot_copy_region
Move checking of conditions, which remain the same for the whole
loop run, outside of the loop.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-08-06 19:08:08 +02:00
Andrej Butok 7e69047b7d boot: zephyr: add support for frdm-mcxn947
Add default configuration for frdm-mcxn947.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-08-02 16:38:26 -06:00
Andrej Butok 899ade2d2a boot: zephyr: boards: Add mimxrt1062_fmurt6 configuration
Add default configuration for mimxrt1062_fmurt6

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-08-02 16:37:52 -06:00
Andrej Butok ae27bc77dc boot: zephyr: boards: Add common mimxrt1050_evk configuration.
- Add common mimxrt1050_evk_mimxrt1052.conf for all revisions.
- Delete the qspi revision mimxrt1050_evk_mimxrt1052_qspi.conf

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-08-02 16:34:11 -06:00
Andrej Butok 6123e9161f boot: zephyr: boards: Add mimxrt11xx configurations
- Add default configurations for mimxrt1160_evk and vmu_rt1170
- Fix configuration for mimxrt1170_evk

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-08-02 16:23:12 -06:00
David Vincze f763c5ffee imgtool: Add missing encodings to emitter tests
Signed-off-by: David Vincze <david.vincze@arm.com>
Change-Id: Iff37cb62514b181a30f5537d6692d55e3d9c73ed
2024-08-01 15:21:51 +02:00
Dominik Ermel 3f11286e2e boot: Remove image_index from boot_encrypt
boot_encrypt required the image_index paired with flash area pointer
to be able to figure out which slot it will operate on.
Since in most calls the slot is known in advance it can be just
passed to the function directly.
The commit replaces both parameters with slot number.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-08-01 15:21:06 +02:00
David Vincze 2a7565b338 bootutil: Move encryption key function to common file
Move the definition of boot_enc_retrieve_private_key() to a common file
to avoid code duplication and also endure seamless transition to this new
key handling approach for targets which don't use hardware keys.

Change-Id: I57e54e4332503c11d18762f8291c3cab53df3d20
Signed-off-by: David Vincze <david.vincze@arm.com>
2024-07-31 16:55:55 +02:00
David Vincze 0e5e1a9fc6 Reapply "boot: Add MCUBOOT_HW_KEY support for image encryption"
This reverts commit c06f7bb367.

Signed-off-by: David Vincze <david.vincze@arm.com>
Change-Id: Ic2ab2c4d3981dec3cd3c25a50b5a989000375372
2024-07-31 16:55:55 +02:00
Rustam Ismayilov ef598b13b5 imgtool: Fix getpub fails for ed25519 key
Fix getpub command fails to emit public pair of ed25519 key with
encoding.

Signed-off-by: Rustam Ismayilov <rustam.ismayilov@arm.com>
Change-Id: I3d255f576b2d8a8d0cbc8e31ff378717acb060c7
2024-07-30 10:37:52 +02:00
Jamie McCrae 078874fbf0 docs: release-notes: Add note on name clash fix
Adds a note about the name clash fix for zephyr

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-26 14:26:27 +01:00
Jamie McCrae 8456464c04 zephyr: Fix issue with sysbuild if something else is named mcuboot
Fixes an issue which can occur in tests whereby an application
has the name mcuboot but is not mcuboot itself

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-26 14:26:27 +01:00
Fabio Utzig d5e0e89568 Fix style issues
Convert tab to spaces; fix opening brace position.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2024-07-25 14:45:29 +02:00
Dominik Ermel d09112acf6 boot: Reduce repeating code in boot_decrypt_and_copy_image_to_sram
There was not really needed repetition of code in if-else
block; common code has been moved out and the block has been
reduced.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-07-25 14:44:26 +02:00
Dominik Ermel 7f9ac97951 boot: Change boot_enc_load to take slot number instead of image
In all cases where boot_enc_load is called it is known what slot
is addressed, so it is better to just pass the slot number
instead of making the boot_enc_load figure out slot number from
image index and provided flash area object.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-07-25 14:30:38 +02:00
Jamie McCrae 71120e4224 docs: release-notes: Add note on fixed zephyr RAM load address
Adds a note about this fix

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-25 14:14:22 +02:00
Jamie McCrae 7fc3ad3d0b boot: zephyr: Fix RAM load chain load address
Fixes showing the wrong address when booting a RAM load image

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-25 14:14:22 +02:00
Rustam Ismayilov 49976dc678 imgtool: Bump cryptography library version
Update requirements.txt to support PrivateKeyType and
PublicKeyType which are available in cryptography library since
version 40.0.0 and prevent failing CI jobs in upcoming changes.

Signed-off-by: Rustam Ismayilov <rustam.ismayilov@arm.com>
Change-Id: I94b888d64c2f33ccb829912491e3b8c44b9cc2b2
2024-07-25 14:00:14 +02:00