Add downgrade prevention for swaps

Currently, downgrade prevention was limited to overwrite only
builds (version check) or devices with hardware storage for
security counter.

This extends downgrade prevention to be used when swap update
is selected.
Unlike MCUBOOT_HW_ROLLBACK_PROT option it does not require user
code to provide external way to store security counter.
Security counter from slot 1 image is used for comparison.
With security counter usage it is possible to have limited
software rollback if security counter was not incremented.

It is possible to use image version where strict rule for
image version comparison prevents any downgrades.

Downgrade prevention is also added to mynewt configuration.

If image in slot 1 is marked as pending and downgrade prevention
is in place, image will be deleted to avoid check on next boot.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
4 files changed
tree: ab634f9f62339714d7071454a45e1a977bf8fdd2
  1. .github/
  2. boot/
  3. ci/
  4. docs/
  5. ext/
  6. ptest/
  7. samples/
  8. scripts/
  9. sim/
  10. testplan/
  11. zephyr/
  12. .gitignore
  13. .gitmodules
  14. .mbedignore
  15. .travis.yml-disabled
  16. Cargo.lock
  17. Cargo.toml
  18. CODE_OF_CONDUCT.md
  19. enc-aes128kw.b64
  20. enc-aes256kw.b64
  21. enc-ec256-priv.pem
  22. enc-ec256-pub.pem
  23. enc-rsa2048-priv.pem
  24. enc-rsa2048-pub.pem
  25. enc-x25519-priv.pem
  26. enc-x25519-pub.pem
  27. go.mod
  28. LICENSE
  29. NOTICE
  30. project.yml
  31. README.md
  32. repository.yml
  33. root-ec-p256-pkcs8.pem
  34. root-ec-p256.pem
  35. root-ed25519.pem
  36. root-rsa-2048.pem
  37. root-rsa-3072.pem
README.md

MCUboot

Package on PyPI Coverity Scan Build Status Build Status (Sim) Build Status (Mynewt) Publishing Status (imgtool) Build Status (Travis CI) Apache 2.0

This is MCUboot version 1.10.0-dev

MCUboot is a secure bootloader for 32-bits microcontrollers. It defines a common infrastructure for the bootloader and the system flash layout on microcontroller systems, and provides a secure bootloader that enables easy software upgrade.

MCUboot is not dependent on any specific operating system and hardware and relies on hardware porting layers from the operating system it works with. Currently, MCUboot works with the following operating systems and SoCs:

RIOT is supported only as a boot target. We will accept any new port contributed by the community once it is good enough.

MCUboot How-tos

See the following pages for instructions on using MCUboot with different operating systems and SoCs:

There are also instructions for the Simulator.

Roadmap

The issues being planned and worked on are tracked using GitHub issues. To give your input, visit MCUboot GitHub Issues.

Source files

You can find additional documentation on the bootloader in the source files. For more information, use the following links:

  • boot/bootutil - The core of the bootloader itself.
  • boot/boot_serial - Support for serial upgrade within the bootloader itself.
  • boot/zephyr - Port of the bootloader to Zephyr.
  • boot/mynewt - Bootloader application for Apache Mynewt.
  • boot/nuttx - Bootloader application and port of MCUboot interfaces for Apache NuttX.
  • boot/mbed - Port of the bootloader to Mbed OS.
  • boot/espressif - Bootloader application and MCUboot port for Espressif SoCs.
  • boot/cypress - Bootloader application and MCUboot port for Cypress/Infineon SoCs.
  • imgtool - A tool to securely sign firmware images for booting by MCUboot.
  • sim - A bootloader simulator for testing and regression.

Joining the project

Developers are welcome!

Use the following links to join or see more about the project: