Commit Graph

1219 Commits

Author SHA1 Message Date
David Brown 50d24a5751 Preps for v1.6.0 release
Update README, release notes the mynewt repository file, and imgtool for
the v1.6.0 release.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-22 11:59:39 -06:00
Joakim Andersson b0890aeaa4 kconfig: Update to CONFIG_FLOAT to CONFIG_FPU rename in zephyr
Update CONFIG_FLOAT to CONFIG_FPU which has been renamed in zephyr.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-05-22 10:10:13 -06:00
David Vincze 9015a5d404 boot: Fix uninitialized variable warning
Fix uninitialized variable warning that may occur when
compiler optimization is enabled (especially for size).

Change-Id: Id56669a2079ac20edbf74c17f943c974f1e8bf93
Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-05-18 15:53:53 -06:00
Kumar Gala 45b00acf0f scripts/assemble: Rework to use EDT library to get devicetree data
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-05-15 15:11:56 -06:00
Kumar Gala 00108fe973 sim: Fixup devicetree.h for changes to mcuboot
Fixup how we fake out devicetree.h, which is now really the flash map
API for what mcuboot is using.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-05-15 15:11:56 -06:00
Andrzej Puzdrowski 7024340b66 zephyr: Change DT_FLASH_AREA_ macros to FLASH_AREA for multimage
Use the new FLASH_AREA_ macros.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-05-15 15:11:56 -06:00
Kumar Gala 6e26e38585 zephyr: Change DT_FLASH_AREA_ macros to FLASH_AREA_
As we replace the legacy DT_FLASH_ support use the new FLASH_AREA_
macros.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-05-15 15:11:56 -06:00
Arvin Farahmand fb5ec1877d zephyr: add option to disable cryptographic check of the image
- Add Kconfig option `CONFIG_BOOT_SIGNATURE_TYPE_NONE`. When y,
  The bootloader will not verify the cryptographic signature of the image
  at boot or prior to upgrade. Image integrity check is retained.

  Images would still need to be processed using `imgtool` however no key
  should be provided to skip cryptographic signature generation.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2020-05-15 12:07:20 -06:00
Arvin Farahmand f824019956 boot: bootutil: add option to disable cryptographic check of the image
- If MCUBOOT_SIGN_RSA, MCUBOOT_SIGN_EC, MCUBOOT_SIGN_EC256 are not
  defined cryptographic signature check is skipped during validation.
  sha256 check is still retained. This reduces the binary size, at the
  expense of greatly reduced security. However this can be acceptable
  in some scenarios where cryptographic check is not required.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2020-05-15 12:07:20 -06:00
Øyvind Rønningstad 16d7b73cd2 serial_recovery: Reduce minimum number of members in packet
Was 3, but mcumgr sometimes sends 2 ("off" + "data", "len" is not needed
when "off" != 0). Reduce to 1 to avoid the problem, since the code
has other checks to catch this.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-05-13 07:59:22 -06:00
David Brown 57f0df3e18 boot_serial: Initialize possibly initialized variable
The variable `dec_off` can possibly be uninitialized in this function.
As long as the serial protocol used is formed correctly, the
initialization will always happen.  Place an initialization upon
function entry to protect against a case where a malformed protocol is
able to provoke this variable being used before being initialized.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-12 13:50:58 -06:00
David Brown 4cb70ccb0e Add a link to the simulator from the top-level README
Hopefully this will help a little with awareness of the existence of the
simulator.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-12 08:38:46 -06:00
David Brown a3a96fed85 sim: Add `--recursive` to submodule update
Now that mbed tls has its own submodules, add `--recursive` to the
sample invocation of submodule update.  Without this, building the
simulator produces difficult messages about `sha256.c` missing.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-12 08:38:46 -06:00
David Brown 82c5f7c65c Preps for 1.6.0-rc2 release
Update various version fields.  Also include a note in the release notes
describing Zephyr compatibility.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-06 08:40:22 -06:00
Kumar Gala 9a5b95158e zephyr: convert DT_JEDEC_SPI_NOR_0_LABEL to new dt macros
As the DT define DT_JEDEC_SPI_NOR_0_LABEL is intended to be deprecated
move to the new macro style to determine for DT_JEDEC_SPI_NOR_0_LABEL

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 13:34:11 -06:00
Kumar Gala 32b61f333b zephyr: Replace DT_FLASH_DEV_NAME with DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL
As upstream zephyr is phasing out DT_FLASH defines for non-partition
usage replace DT_FLASH_DEV_NAME with
DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 13:34:11 -06:00
Andrzej Puzdrowski f4a9a9d7e9 zephyr/Kconfig: reference missing new Nordic boards keywords
Updated boards reference names.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-04-30 13:25:54 +02:00
Fabio Utzig 377307de7d Fix imgtool publishing missing python package
Add missing `packaging` to allow version comparison.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-23 12:03:48 -06:00
Fabio Utzig 14301abbc1 travis: add imgtool publishing
Add new CI vm that parses the imgtool version from __init__.py and
compares with the current published release. If the version in the repo
is newer it will be published automatically.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-23 09:56:58 -06:00
David Brown 342e875d0f Preps for 1.6.0-rc1
Update version fields, and add release notes for the 1.6.0-rc1 release.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-04-22 18:27:00 -06:00
David Brown e06ef9bca2 Bump imgtool version to 1.6.0-rc1.
Signed-off-by: David Brown <david.brown@linaro.org>
2020-04-22 18:27:00 -06:00
David Brown aac7111b02 boot: Update copyrights and licenses
To make contributions easier, place explicit copyrights by the major
contributors, along with an SPDX license identifier.  Files that came
from the mynewt project, which was an Apache project will retain the
Apache project license text, although this does not apply to new
contributions, which are being made by individual contributors.

Hopefully, this will keep everyone happy, but allow contributors that
need to add an explicit copyright to have a place they can add that.

Fixes #501

Signed-off-by: David Brown <david.brown@linaro.org>
2020-04-22 15:07:28 -06:00
David Vincze 25459bffcc docs: Provide description for multiple features
- Update documentation of 'HW based downgrade prevention'
- Add description for the following features:
      MCUBOOT_MEASURED_BOOT
      MCUBOOT_DATA_SHARING
      MCUBOOT_HW_KEY

Change-Id: If7247e906de3028d44cdd9d14a5004661fb955af
Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-04-22 14:25:21 -06:00
David Vincze 4e3c47bfca docs: Fix Markdown rendering issues
- Fix rendering issues of multi-line HTML comments (license headers)
- Fix rendering issues of footnotes

Change-Id: I06c8ad3454a62187e9d527df62560b897ec478f4
Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-04-21 15:42:29 -06:00
David Brown e3cbbece36 Use _Static_assert on all platforms
This macro is part of the C11 standard.  Remove the use of a specialized macro
just for Zephyr, and use the standard macro for all platforms.  This reduces
dependencies on specific versions of Zephyr.

In addition.  The Zephyr-specific code was using toolchain/gcc.h which
would only work with gcc.h, so doesn't actually address any of the
objections.  If this ever becomes a problem with Zephyr, we can figure
out a proper way to fix this.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-04-21 08:20:29 -06:00
Bohdan Kovalchuk 7725652e30 Add files to eliminate HAL dependency, build/compile pass
Signed-off-by: Bohdan Kovalchuk <bohd@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@cypress.com>
2020-04-21 07:55:10 -06:00
David Vincze 80a76f4af4 imgtool: release 1.6.0alpha3
Change-Id: I1a32938745c07c517743d2af9d0d5d2620813852
Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-04-14 12:27:16 +02:00
Fabio Utzig 20e747c920 mynewt: remove version.yml and references
With the merge of https://github.com/apache/mynewt-newt/pull/365 `newt`
does not use `version.yml` files anymore, so remove the file and
references to updating it in the release process.

Testing a MCUBoot release now depends on `newt` `master` or `> 1.7.0`
(to be released).

Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-12 14:31:28 -03:00
Gerson Fernando Budke 87f50a5667 zephyr: boards: Add disco_l475_iot1 config file
The STM32L475 needs BOOT_MAX_IMG_SECTORS equal 256 to work properly.
This add a config file to change default value from 128 to 256 once
there isn't a proper way to handle using Device Tree.

fixes zephyrproject-rtos/zephyr/issues/24243

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-11 11:58:43 -03:00
David Vincze 1e0c54429d imgtool: Set RAM_LOAD flag in header when needed
Set the RAM_LOAD flag in the image header when a load address was passed
to the imgtool script, indicating that the image should be loaded into
RAM and run from there.

Change-Id: Id9d2c179d7fa1ff7d15cf671c09c61b5b78c88a8
Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-04-10 15:31:25 -06:00
Fabio Utzig 7973f573b7 imgtool: bump version to 1.6.0-alpha2
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 92eb07fe3e boot: mynewt: add ECIES-X25519 support
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 5eaa57647e docs: Update with X25519 encrypted images info
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig b6f014c4bc boot: zephyr: add ECIES-X25519 support
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 4facd1b7c7 imgtool: Add x25519 key generation and getpriv
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 960b4c5ef0 imgtool: Add ECIES-X25519 image encryption support
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 67c59fa5ad imgtool: Fix ECDSA references in ED25519
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 1e1c1c6a5f travis: Add x25519 encrypted image testing to CI
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 3fa72ca12f sim: Add test support for x25519 encrypted images
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 6aec6ae0b0 boot: bootutil: add x25519 encrypted image support
- Define new TLV for carrying information for x25519 based encrypted
  images.
- Add routines to parse embedded encryption key, generated shared
  secret and image decryption key.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 3fc84bf686 keys: Add sample x25519 priv/pub keys
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig feb6c4cd40 caps: Add cap for x25519 based image encryption
Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
Fabio Utzig 8fcdb6d066 ext: fiat: add X25519 routines from upstream
Upstream sha was: 92b7c89e6e8ba82924b57153bea68241cc45f658

Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-10 17:56:14 -03:00
David Vincze 03368b8bec boot: Add hardware key support
This change enables the public key (used for image authentication) to
be removed from MCUboot and be appended to the image instead. In this
case the key or its hash must be provisioned to the device and MCUboot
must be able to retrieve the key-hash from the hardware to compare it
with the calculated hash of the public key from the image manifest in
order to verify its validity before image authentication.

The source of this change:
https://review.trustedfirmware.org/c/trusted-firmware-m/+/1581

Change-Id: I36fe699732e0e4c113eaed331c22e707c722ed6e
Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-04-07 09:20:13 -06:00
David Vincze dde178dbc8 imgtool: Add --public-key-format option to imgtool
The --public-key-format option can be used to distinguish where
the public key is stored for image authentication. It can be embedded
in MCUboot or by selecting 'full' it can be in the image manifest.

The source of this change:
https://review.trustedfirmware.org/c/trusted-firmware-m/+/1579

Change-Id: If658dff8147cfce2f27bfc0209ecf0d6d9cb2a73
Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-04-07 09:20:13 -06:00
Fabio Utzig 9560d77371 imgtool: keys: fix tests
Fix tests that were broken due to changes in key interfaces.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-06 17:34:57 -03:00
Andrzej Puzdrowski 41c5d50ec7 zephyr:boards nrf52840_pca10059 rename to nrf52840dongle_nrf52840
Board was renamed here:
zephyrproject-rtos/zephyr#24049

Patch aligns the name in MCUBoot.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-04-06 11:14:25 +02:00
Piotr Mienkowski a5046693a2 zephyr: arm_cleanup.c: use <.../cortex_m/cmsis.h>
Use <arch/arm/aarch32/cortex_m/cmsis.h> include instead of <zephyr.h> to
get access to Cortex-M CMSIS API. zephyr.h provides kernel API, does not
guarantee access to CPU internals.

Fixes: #699 "Building MCUBoot for Zephyr fails on multiple ARM boards"

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-04-02 12:51:07 +02:00
Fabio Utzig 165e00e9e0 Update fiat from latest upstream
Update from upstream: 92b7c89e6e8ba82924b57153bea68241cc45f658

Signed-off-by: Fabio Utzig <utzig@apache.org>
2020-04-02 07:00:46 -03:00
Henrik Brix Andersen a40b199761 scripts: assemble.py: switch to using devicetree_legacy_unfixed.h
Switch to using the devicetree_legacy_unfixed.h header for extracting
flash partition information.

Zephyr has switched to using a new gen_defines.py script and a new set
of macros/defines for devicetree code generation for all nodes except
flash partitions, which are still in the legacy format.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-03-31 08:47:40 -03:00