Commit Graph

2137 Commits

Author SHA1 Message Date
Roland Mikhel 5899face4d sim: PSA Crypto ECDSA enablement
This commit enables ECDSA signature verification using
PSA Crypto API.

Signed-off-by: Roland Mikhel <roland.mikhel@arm.com>
Change-Id: I33f559ecdd59b1ce41c6a2d5f315212300d585e3
2023-09-12 16:29:11 +02:00
Roland Mikhel 274547ce06 bootutil: PSA Crypto ECDSA enablement
This commit enables ECDSA signature verification using
PSA Crypto API.

Signed-off-by: Roland Mikhel <roland.mikhel@arm.com>
Change-Id: I51c7aadba03348f335e89d9252e70c09f8787f30
2023-09-12 16:29:11 +02:00
Jamie McCrae 8f8fbf9956 zephyr: Fall back to minimal C library
Changes back to the minimal C library instead of picolibc to
reduce flash usage

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-09-12 14:16:03 +01:00
Jamie McCrae 5c5222f884 boot_serial: Fix include
Fixes an include which is needed for multiple options by just
always including it, and fixing the path so it can be included.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-09-12 12:56:39 +02:00
Sylvio Alves b847a33ba2 espressif: use minimal libc as default for ESP32 boards
Make MINIMAL_LIBC as default for MCUboot app build instead
of picolibc. Footprint is lower and no need to
MULTLTHREADING enabled for SoC build.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2023-09-08 11:01:07 -03:00
Benjamin Bigler 480b97f2e2 boot_serial: Fix missing point if using snprintf
Adds missing point in version when snprintf is used

Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
2023-09-08 07:40:03 +01:00
Piotr Dymacz 3790f5f055 boot: zephyr: use indication LED also in timeout based recovery
This adds support for indication LED option (MCUBOOT_INDICATION_LED) in
the timeout based recovery. Configured LED will be enabled when entering
the recovery and disabled after selected timeout (if no mcumgr command
was received).

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-09-07 11:37:34 +01:00
Dominik Ermel 0035c33b44 zephyr: Provide third image cases for direct image upload
The commit adds missing support for direct upload of third
image slots.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-09-06 17:49:33 +02:00
Lucas Tamborrino 9bf7ce8c5f zephyr: Fix build for non-arm archs
Guards the inclusion of cmsis_core header for
ARM targets only.

Fixes #1799

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-09-06 10:07:09 +01:00
Fabio Utzig f0ad026fa7 docs: add webrick dependency
webrick needs to be installed for ruby versions >3, which should ease
local testing for someone running newer versions. This is compatible
with running on ruby 2.7.4, the version used on github pages.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2023-09-05 20:06:14 -03:00
Fabio Utzig b688ef77cc docs: add jemoji plugin
This plugin enables jekyll to display emojis; the version added matches
current on github-pages (https://pages.github.com/versions/)

Signed-off-by: Fabio Utzig <utzig@apache.org>
2023-09-05 20:06:14 -03:00
Fabio Utzig 54fd52d914 docs: update github-pages and deps versions
Update to versions matching: https://pages.github.com/versions/

Signed-off-by: Fabio Utzig <utzig@apache.org>
2023-09-05 20:06:14 -03:00
Fabio Utzig b58962fad9 docs: espressif: fix formatting of markdown
Fix documentation issues for the rendering of the Espressif README
page. No content is changed with this commit, but formatting and
line breaks are set to approximately 100 columns.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2023-09-04 16:50:11 -03:00
Fabio Utzig 0d2772cee8 Add Espressif build status badge
Add new badge to easily check build status for Espressif CI.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2023-09-02 16:04:24 -03:00
Jamie McCrae e188dbb0e1 zephyr: Fix boot serial extensions
Fixes building the bootloader with serial recovery mode and boot
serial extensions enabled due to changes in Zephyr's MCUmgr file
and naming changes.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-29 16:01:02 +02:00
Gerard Marull-Paretas 11ecbf639d zephyr: use cmsis_core.h header
CMSIS glue code is now provided by the CMSIS Zephyr module in
<cmsis_core.h>. Header is generic for M/A/R.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-08-25 11:30:17 +02:00
Dominik Ermel da65db0076 zephyr: Provide slot definitions for three images
Support for three pairs of slots.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-08-24 14:13:55 +02:00
Dominik Ermel 4ff95da6f6 bootuil: Replace flash_area_id_to_image with flash_area_to_image
Move flash_area_get_id inside the function and rename it.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-08-22 14:24:03 +02:00
Dominik Ermel 2c61caf606 bootutil: Move flash_area_id_to_image under ifdef
The commit moves the flash_area_id_to_image to section compiled
only when not in DirectXIP mode, to prevent warnings about unused
static functions.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-08-22 10:52:52 +02:00
Dominik Ermel 904d0c4608 bootutil: Add DirectXIP version of boot_set_next
The commit adds DirectXIP version of bootutil boot_set_next
function.
The function is enabled by configuration option:
MCUBOOT_BOOTUTIL_LIB_FOR_DIRECT_XIP.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-08-18 11:10:19 +02:00
Jamie McCrae d9a0074d4c docs: release: Add note on zephyr debug mode
Adds a note that zephyr builds no longer build in debug mode
by default

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-18 09:05:13 +01:00
Jamie McCrae 2a874b6e9c zephyr: Do not build in debug mode
Builds in the default zephyr mode (optimised for size) which
saves about 6KiB of flash on a default nrf52840dk build.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-18 09:05:13 +01:00
Jamie McCrae 258a6c7dc2 bootutil: Fix support for more than 2 flash areas
Fixes a function which converts from an ID to an image number
to support more than 2 images.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-17 16:00:12 +02:00
Fabio Utzig b206b99b15 ci: mynewt: Update to install upstream Mbed-TLS
Update after recent removal of Mbed-TLS from Mynewt tree; now using
upstream from Mbed-TLS github repo.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2023-08-10 14:29:44 -07:00
Almir Okato 8647964e64 espressif: add release notes
Signed-off-by: Almir Okato <almir.okato@espressif.com>
2023-08-10 10:59:33 -07:00
Almir Okato 4a051181c4 espressif: esp32xx: adjust memory map on linker script
Reorganize memory mapping and document the address ranges that
the OS must avoid overlapping.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2023-08-10 10:59:33 -07:00
Almir Okato c1efa00b8d espressif: update documentation regarding ESP32-C2, ESP32-C6 and ESP32-H2
Signed-off-by: Almir Okato <almir.okato@espressif.com>
2023-08-10 10:59:33 -07:00
Almir Okato 68a2980f97 espressif: esp32c2: remove unsupported configs
Remove unsupported USB JTAG configuration
Remove unsupported Secure Boot V2 configuration

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2023-08-10 10:59:33 -07:00
Almir Okato 2f17549ef3 espressif: esp32c6 esp32h2: fix custom uart and secure boot build
Fix missing header on console_uart_custom.c
Update secure_boot.c includes removing soc ifdefs

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2023-08-10 10:59:33 -07:00
Jamie McCrae fc658eb5a2 docs: release: Add note on encryption changes
Adds notes on fixes and changes related to encrypted image handling

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-09 07:45:22 +01:00
Jamie McCrae c9fa60886b boot: boot_serial: Fix issue with encrypted second slot images
Fixes issues whereby encrypted images were not properly listed due
to not treating them as encrypted, also removes a piece of wrong
hack code that would never run as the primary slot cannot be
encrypted.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-09 07:45:22 +01:00
Jamie McCrae 25d2f2cfe0 zephyr: encryption: Improve Kconfig and key generation
Improves the Kconfig layout for encrypted image support and allows
using key files instead of just using a pre-defined, insecure dummy
key.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-09 07:45:22 +01:00
Bence Balogh 70acc4146e release-notes: Add imgtool changes
Signed-off-by: Bence Balogh <bence.balogh@arm.com>
Change-Id: I48eabb1dc9696ef50d12fc8782616169ba8acc45
2023-08-08 18:09:07 +02:00
Bence Balogh 97a20f1286 imgtool: Add public key's SHA256 hash calculation
Signed-off-by: Dávid Házi <david.hazi@arm.com>
Signed-off-by: Bence Balogh <bence.balogh@arm.com>
Change-Id: I91d5c07c1bb2b8abe2592cd49b2053c881465ba2
2023-08-08 18:09:07 +02:00
Bence Balogh ed8d68aff7 imgtool: Add raw output option
Signed-off-by: Dávid Házi <david.hazi@arm.com>
Signed-off-by: Bence Balogh <bence.balogh@arm.com>
Change-Id: Ia7f385e5e1b0471aae7693baa54e9a385ad3ae3f
2023-08-08 18:09:07 +02:00
Bence Balogh 367aefbede imgtool: Add write to file option
Signed-off-by: Dávid Házi <david.hazi@arm.com>
Signed-off-by: Bence Balogh <bence.balogh@arm.com>
Change-Id: I6028955be5cbcd20d49ef2126dce8d4636b824a6
2023-08-08 18:09:07 +02:00
Michael Grand 99613c672f bootutil: fix downgrade prevention
Downgrade prevention check moved to secure both TEST
and PERMANENT upgrade modes. Downgrade can still be
performed during REVERT.

Signed-off-by: Michael Grand <m.grand@trustngo.tech>
2023-08-08 09:02:39 +01:00
Jamie McCrae 88b2865730 doc: design: Add updated information on data sharing
Adds additional information on the new BOOTINFO data sharing
functionality

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-08 08:02:25 +01:00
Jamie McCrae 97d18797a1 docs: Add note on addition of new shared boot info
Adds a note that there is now additional information that can
(optionally) be provided via shared boot information.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-08 08:02:25 +01:00
Jamie McCrae 5b1d5116a9 boot: bootutil: Add optional boot info shared data saving
Adds the ability to share MCUboot configuration with
applications via shared memory.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-08 08:02:25 +01:00
Jamie McCrae ea88860904 bootutil: Add bootloader info TLV entries
Adds TLV defines for use with the bootloader shared data
feature.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-08 08:02:25 +01:00
Jamie McCrae 3016d00cd7 bootutil: Add active slot number and max app size to shared data
This allows the currently executing slot number to be checked by
the external function, which can be used by XIP images to know
which slot is currently being executed from to allow for correct
uploading/positioning of firmware files, and also provides the
maximum size of an upgrade that can be loaded so that applications
can reject images that are too large.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-08 08:02:25 +01:00
Dominik Ermel 0540d0fb3f bootutil: Fix for flash_area_id_to_image
The function was incorrectly identifying partition of secondary slot
of image 0 as belonging to image 1, at the same time failing to
identify partition of primary slot of image 1.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-08-07 14:35:39 +02:00
Dominik Ermel f17b005ca1 bootutil: Fix boot_set_next passing wrong image number
The commit fixes boot_set_next always passing image 0 to
boot_write_swap_info, instead of the proper image number.
This has been affecting applications that tried to call boot_set_next
in multi-image MCUboot configuration using scratch-swap algorithm.

Fixes #1762

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-08-04 16:17:38 +02:00
Daniel Mangum fefc398cc1 fix: update zephyr CONFIG_BOOTLOADER_MCUBOOT
Updates the zephyr CONFIG_BOOTLOADER_MCUBOOT documentation link to
target the new location.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-08-03 07:46:53 +01:00
Michal Lenc aa7e2b1faa nuttx: switch to flash_area_get_sector
Function flash_area_sector_from_off is replaced with newly used
flash_area_get_sector to cope with calls in bootutil_misc.c file.

This is required for CONFIG_MCUBOOT_SWAP_USING_MOVE to work correctly.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-02 11:28:34 +02:00
Jamie McCrae 61898dad92 boot: boot_serial: Add updated SMP header
Adds missing fields which were wrongly treated as part of the
operation value, which they were not, and adds a big/little
endian check.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-31 08:32:50 +01:00
Marcin Niestroj 36ae4fdabf boot: zephyr: split esp32 to esp32_devkitc_{wroom,wrover}
This is a follow-up on upstream Zephyr split from `esp32` to distinct
esp32_devkitc_wroom and esp32_devkitc_wrover (see [1] and [2]).

[1] https://github.com/zephyrproject-rtos/zephyr/pull/58454
[2] 3776402f40

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2023-07-29 09:54:47 -03:00
Jamie McCrae 2c86755278 boot: zephyr: Fix indication LED not selecting GPIO
Makes indication LED Kconfig select GPIO so that it can work.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-27 16:35:01 +01:00
Michal Gorecki 5404130e20 boot_serial: Fix build for 64-bit architectures
Typecasting pointer variables to uint32_t
instead of uintptr_t was causing build error
on 64-bit architecture.

This is useful, because I am currently working
on implementing support for 64-bit native target
in Apache Mynewt. There is unit test for boot_serial
and it cannot be compiled without this changes.

Signed-off-by: Michal Gorecki <michal.gorecki@codecoup.pl>
2023-07-26 13:16:21 +01:00