Commit Graph

1589 Commits

Author SHA1 Message Date
dependabot[bot] f2ac70db18 build(deps): bump nokogiri from 1.11.2 to 1.11.4 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.2 to 1.11.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.2...v1.11.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-19 07:16:47 -03:00
Salome Thirot 7084b2ff9c Workflow: enable AES256 image encryption tests
Signed-off-by: Salome Thirot <salome.thirot@arm.com>
2021-05-18 07:25:12 -03:00
Salome Thirot 6fdbf55756 Sim: Add testcases for AES256 image encryption
Signed-off-by: Salome Thirot <salome.thirot@arm.com>
2021-05-18 07:25:12 -03:00
Salome Thirot 0f64197aff boot: Add AES256 support for image encryption
Support only works when using mbedtls as the cryptographic library.

Signed-off-by: Salome Thirot <salome.thirot@arm.com>
2021-05-18 07:25:12 -03:00
Andrzej Puzdrowski 9b97456eb2 zephyr/main: allow to build when CONFIG_MULTITHREADING=n
K_sleep() is not available when multithreading is disabled.
Let's use k_busy_wait() in that case.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-17 15:43:12 +02:00
Andrzej Puzdrowski 0cf0dbdd9c boot_serial: allow to build when CONFIG_MULTITHREADING=n
For zephyr-rtos:
K_sleep() is not available when multithreading is disabled.
Let's use k_busy_wait() in that case.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-17 15:43:12 +02:00
George Beckstein d4d90f8eea Fix version comparison result causing boot failure
The variable `rc` is used in `context_boot_go` for a number of operations, mostly checking return codes for an error. It is also used to store the result of comparing the installed application version numbers (using `boot_version_cmp`).

At the end of `context_boot_go`, `rc` is returned as the result of the operation.

In some configurations, namely direct XIP (without revert or any other extra boot checks), it is possible for the comparison result to be the last value of `rc`. In most cases, this will cause `context_boot_go` to report a failure (ie: non-zero return code), as the value of `rc` will be 1 or -1 if the installed applications aren't the same version.

This commit resets the value of `rc` to 0 after the version comparison has taken place.

Fixes #976

Signed-off-by: George Beckstein <george.beckstein@gmail.com>
2021-05-14 14:57:17 -06:00
David Brown fe0bfcfba9 Migrate master->main
Change references in CI and docs from 'master' to 'main' as the primary
branch has been renamed.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-05-14 14:56:39 -06:00
Andrzej Puzdrowski 137d797177 sim: emits *_SWAP_USING_SCRATCH macros
Emits either MCUBOOT_SWAP_USING_SCRATCH and
CONFIG_BOOT_SWAP_USING_SCRATCH when swap using scratch
algorithm is expected.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-14 14:19:56 +02:00
Andrzej Puzdrowski c49d7c9398 zephyr: allow to not defined scratch area in upgrade-only mode
Scratch area is unneeded if CONFIG_BOOT_SWAP_USING_SCRATCH=n.
This was not reflected so fare which causes build faliure.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-14 14:19:56 +02:00
Andrzej Puzdrowski 414f915518 boot: Don't examine scratch in BOOT_UPGRADE_ONLY mode
During fetching of swap-status scratch was examined unnecessary
in swap_status_source(). Scratch area shouldn't be needed in this mode.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-14 14:19:56 +02:00
Sherry Zhang fbeef9b944 bootutil_public.c: add two user APIs
Add boot_set_pending_multi() and boot_set_confirmed_multi() APIs so
that the user can set the image with given index as pending, confirmed.

Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
Change-Id: Ifca04d396b38c6c64581703794071f6b42e9dfbf
2021-05-14 06:51:38 -03:00
George Beckstein a80e7c6715 Enable no signature verification configuration for Mbed-OS.
This commit introduces changes to allow the Mbed-OS port to disable use of signature verification. Previously this was not possible even though it is a valid mcuboot configuration.

Signed-off-by: George Beckstein <george.beckstein@gmail.com>
2021-05-12 13:30:06 -06:00
Bora Özgen 66f02e30b0 Mbed: Remove unused header size config
Signed-off-by: Bora Özgen <oezgen@nantis.de>
2021-05-08 07:13:09 -03:00
Jamie McCrae 10a8112089 zephyr: add Laird Connectivity BL5340 recovery pin
Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-05-07 12:20:47 -03:00
Andrzej Puzdrowski 22b856beea bootutil_public: allow to confirm padded image without copy-done flag
This patch is for fixing:
https://github.com/zephyrproject-rtos/zephyr/issues/34683

copy-done flag is used to design completely copied image.
It is used to recognize whether need to complete image upgrade.
If image is running then:
1) it was already verified and copied by MCUboot
   copy-done flag is set for sure.
2) or it was programmed directly using programming interface

For case 2) when image contains magic but not copy-done flag it was
impossible to confirm it. This patch removes needs of having copy-done
flag set while confirming. This make API behavior similar to situation
when the not-padded image was programmed.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-07 13:53:00 +02:00
Fabio Utzig c932b32ab0 workflows: enable Mbed TLS based EC backend tests
Enable sig-ecdsa-mbedtls and enc-ec256-mbedtls simulator tests.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-05-06 21:05:47 -03:00
Fabio Utzig 6c553d6741 sim: add Mbed TLS EC256 encrypted image support
Add new feature that allows testing EC256 encrypted images using the
Mbed TLS backend.

Move config-ecdsa.h to config-ec.h because definitions are very similar
between ECDSA and ECDH with Mbed TLS so resort to a single config file.

Add new feature and fix the build; add proper Mbed TLS memory
initialization when enc-ec256-mbedtls is used.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-05-06 21:05:47 -03:00
Fabio Utzig 74c3bab496 crypto: ecdh: define NUM_ECC_BYTES for Mbed TLS
This is a define from Tinycrypt that was being used in the Mbed TLS
EC256 encrypted images implementation so properly define it.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-05-06 21:05:47 -03:00
Maureen Helm b6d75e765f boot: zephyr: Configure mimxrt106x_evk boards
The mimxrt1060_evk and mimxrt1064_evk boards have large slots so we need
to increase CONFIG_BOOT_MAX_IMG_SECTORS from the default.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-05-06 06:53:26 -03:00
Philip Colmer aad01efd58 Create CNAME 2021-05-04 15:47:49 +01:00
dependabot[bot] 000ef72ac4 build(deps): bump rexml from 3.2.4 to 3.2.5 in /docs
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.4...v3.2.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-04 07:36:10 -06:00
David Brown 208db88779 Delete CNAME 2021-05-04 01:23:13 -06:00
David Brown d23214eb05 Create CNAME 2021-05-04 01:22:29 -06:00
Gerard Marull-Paretas e20e092b7c boot: boot_serial: use new Zephyr reboot header
Use the new header used for sys_reboot on Zephyr.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-29 12:01:35 +02:00
Nico Lastzka e16f52c033 cmake: fix evaluation with empty signature key file
When CONFIG_BOOT_SIGNATURE_KEY_FILE is left empty, the cmake find command gets
called with a wrong number of arguments. This patch skips the search for the
signature key file within config files in that case.

Signed-off-by: Nico Lastzka <Nico.Lastzka@ATSonline.de>
2021-04-20 12:54:02 +02:00
David Brown cdee0b7885 docs: Upgrade doc generating dependencies
Addresses CVE-2021-28834
https://github.com/advisories/GHSA-52p9-v744-mwjj

Also removed the explicit jekyll dependency, which according to the
instructions should be commented out if the github-pages dependency is
used.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-04-13 08:45:11 -03:00
David Brown 986c212ea9 docs: Add links to wikipage on project
Update the main webpage to contain links to the wiki page docs on the
project charter, and the membership page.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-04-02 09:13:59 -06:00
Roman Okhrimenko 579b30c299 cypress: Update docs with new platforms support info
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@infineon.com>
2021-03-25 13:47:01 +02:00
Roman Okhrimenko cc557319f5 cypress: Update core-lib, mob-pdl-cat1 submodules revision
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@infineon.com>
2021-03-25 13:47:01 +02:00
Roman Okhrimenko 4bc2810cb5 cypress: Rework makefiles, reorganise source, add 062_1M and 062_512k support
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@infineon.com>
2021-03-25 13:47:01 +02:00
Dominik Ermel 48281627e1 bootutil: Fix boot_write_trailer write alignment
The commit fixes alignment issue in boot_write_trailer, that would
occur in case when input buffer length would be greater than
alignment parameter of flash.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-25 11:40:39 +01:00
Dominik Ermel a7f9e9f530 bootutil: Remove duplicated code from bootutil_misc.c
Duplicated functions, existing in bootutil_public.c have been removed
from bootutil_misc.c.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-25 11:40:39 +01:00
Szymon Janc 1de4877237 mynewt: Update repository.yml with latest release
newt tool uses repository.yml from master branch.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-03-24 13:01:48 -03:00
Andrzej Puzdrowski 8bd3081f89 boot/zephyr: cleanup GPIO pin setup
Removed configuration of gpio pin using flags which were
removed for zephyr-project long ago. Also old method of read
the pin value was removed.
No sense to keep that as nowadays MCUboot is also not compatible
with zephyr version which supports these flags and methods.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-03-23 12:28:25 +01:00
Bohdan Kovalchuk de51807249 Cypress: add encryption with mbedTLS
Signed-off-by: Bohdan Kovalchuk <bohd@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@infineon.com>
2021-03-16 21:38:06 -03:00
Bohdan Kovalchuk 25c7a0f475 Bootutil/Crypto: add encryption with mbedTLS
Signed-off-by: Bohdan Kovalchuk <bohd@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@infineon.com>
2021-03-16 21:38:06 -03:00
Josh Gao 837cf88f35 zephyr: add an option to use GPIO to enable USB DFU.
Devices with a physical reset button might prefer to use it to enter USB
DFU mode, instead of always entering it with a timeout. Extract the
existing CONFIG_BOOT_SERIAL_DETECT detection code and use it to enter
DFU mode when CONFIG_BOOT_USB_DFU_GPIO is enabled.

This commit depends on zephyrproject-rtos/zephyr#30015, which changes
wait_for_usb_dfu from a nullary function that waits for a compile-time
fixed amount of time, to one that takes a timeout.

Signed-off-by: Josh Gao <josh@jmgao.dev>
2021-03-16 12:48:41 -06:00
Roman Okhrimenko 895300103d cypress: Align cypress mbedtls hw accel implementation with bootutil update
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@infineon.com>
2021-03-12 14:17:28 -07:00
Roman Okhrimenko 2f045a252e bootutil: Align mbedtls_ecdsa signature verification with cypress mbedtls hw accel implementation
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@infineon.com>
2021-03-12 14:17:28 -07:00
David Brown 26edaf3d12 sim: Change a match with empty arm to if let
This reads a little easier.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown f66b2050fa sim: Match structure definition better
This padding field is defined as a u8 and a u16.  Clarify the marshaling
code to match instead of just looping over bytes.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown cae9e2a85b sim: Remove extra blank line
Remove an extra blank line from this file.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown 173e6caaea sim: Remove elided lifetime
This lifetime can be inferred by the compiler, so remove the explicit
one.  This makes the code a little easier to read.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown 80f836d19d sim: Remove complexity from an if
Clippy suggests that having a closure in the condition of an if can be
confusing in regards to code formatting.  Move the conditional outside
of the if into a temp variable.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown d36f6b1c16 sim: Remove extraneous slice reference
Clippy suggests that the reference is unnecessary when making a
comparison.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown 599b2db197 sim: Simplify printing blank line
Per clippy, `println!()` should be used instead of `println!("")`.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown fbc8f7c1c1 sim: Directly iterate instead of using an index
From a clippy suggestion, replace an index iterator over a slice, and
directly use a mutable iterator over the slice.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown aec56b2ba9 sim: Combine a split conditional
Instead of nesting ifs, just use the conditional with an and operator.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00
David Brown 8973f5551b sim: Use Option instead of Err<T, ()>
Instead of using an Err type with no meaningful error type, just use an
Option.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-03-11 07:25:43 -07:00