All Projects → wolfSSL → Wolfboot

wolfSSL / Wolfboot

Licence: gpl-2.0
wolfBoot is a portable, OS-agnostic, secure bootloader for microcontrollers, supporting firmware authentication and firmware update mechanisms.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Wolfboot

Wolfssh
wolfSSH is a small, fast, portable SSH implementation, including support for SCP and SFTP.
Stars: ✭ 142 (+29.09%)
Mutual labels:  embedded, portable, cryptography
Anne Key
Firmware for Anne Pro Keyboard written in Rust
Stars: ✭ 506 (+360%)
Mutual labels:  firmware, embedded
Cranium
🤖 A portable, header-only, artificial neural network library written in C99
Stars: ✭ 501 (+355.45%)
Mutual labels:  embedded, portable
Embedos
EmbedOS - Embedded security testing virtual machine
Stars: ✭ 108 (-1.82%)
Mutual labels:  firmware, embedded
Keyberon
A rust crate to create a pure rust keyboard firmware.
Stars: ✭ 355 (+222.73%)
Mutual labels:  firmware, embedded
Nar
node.js application archive - create self-contained binary like executable applications that are ready to ship and run
Stars: ✭ 428 (+289.09%)
Mutual labels:  embedded, portable
Awesome Embedded
A curated list of awesome embedded programming.
Stars: ✭ 831 (+655.45%)
Mutual labels:  bootloader, embedded
drone-cortexm
ARM® Cortex®-M platform crate for Drone, an Embedded Operating System.
Stars: ✭ 31 (-71.82%)
Mutual labels:  embedded, firmware
Memfault Firmware Sdk
Memfault Firmware SDK for embedded systems. More information at https://docs.memfault.com.
Stars: ✭ 42 (-61.82%)
Mutual labels:  firmware, embedded
Punchboot
Punchboot
Stars: ✭ 49 (-55.45%)
Mutual labels:  bootloader, embedded
Daplink
Stars: ✭ 1,162 (+956.36%)
Mutual labels:  firmware, embedded
Drone Core
The core crate for Drone, an Embedded Operating System.
Stars: ✭ 263 (+139.09%)
Mutual labels:  firmware, embedded
systemboot
SystemBoot is a LinuxBoot distribution that works as a system firmware + bootloader, based on u-root
Stars: ✭ 103 (-6.36%)
Mutual labels:  firmware, bootloader
Awesome Embedded And Iot Security
A curated list of awesome embedded and IoT security resources.
Stars: ✭ 500 (+354.55%)
Mutual labels:  firmware, embedded
mikroe-uhb
USB HID Bootloader programming tool for devices manufactured by MikroElektronika
Stars: ✭ 15 (-86.36%)
Mutual labels:  embedded, bootloader
Stm32 Bootloader
Customizable Bootloader for STM32 microcontrollers. This example demonstrates how to perform in-application-programming of a firmware located on an external SD card with FAT32 file system.
Stars: ✭ 541 (+391.82%)
Mutual labels:  firmware, bootloader
I2pdbrowser
i2pd browser bundle
Stars: ✭ 94 (-14.55%)
Mutual labels:  portable, cryptography
wymlp
tiny fast portable real-time deep neural network for regression and classification within 50 LOC.
Stars: ✭ 36 (-67.27%)
Mutual labels:  embedded, portable
OpenWare
Firmware for OWL devices
Stars: ✭ 23 (-79.09%)
Mutual labels:  embedded, firmware
Exein Openwrt Public
Openwrt 18.06.5 featured with the Exein's security framework
Stars: ✭ 36 (-67.27%)
Mutual labels:  firmware, embedded

wolfBoot

wolfSSL Secure Bootloader (Home page)

wolfBoot is a portable, OS-agnostic, secure bootloader solution for 32-bit microcontrollers, relying on wolfCrypt for firmware authentication, providing firmware update mechanisms.

Due to the minimalist design of the bootloader and the tiny HAL API, wolfBoot is completely independent from any OS or bare-metal application, and can be easily ported and integrated in existing embedded software projects to provide a secure firmware update mechanism.

Features

  • Multi-slot partitioning of the flash device
  • Integrity verification of the firmware image(s)
  • Authenticity verification of the firmware image(s) using wolfCrypt's Digital Signature Algorithms (DSA)
  • Minimalist hardware abstraction layer (HAL) interface to facilitate portability across different vendors/MCUs
  • Copy/swap images from secondary slots into the primary slots to consent firmware update operations
  • In-place chain-loading of the firmware image in the primary slot
  • Support of Trusted Platform Module(TPM)
  • Measured boot support, storing of the firmware image hash into a TPM Platform Configuration Register(PCR)

Components

This repository contains the following components:

wolfBoot bootloader

wolfBoot is a memory-safe standalone bare-metal application, designed to run on a generic microcontroller, with no dynamic memory allocation mechanism or linkage to any standard C library besides wolfCrypt.

The bootloader consists of the following components:

  • wolfCrypt, which is used to verify the signature of the images
  • A minimalist Hardware Abstraction Layer, with an implementation provided for the supported target, which is in charge for IAP flash access and clock setting on the specific MCU
  • The core bootloader
  • A small application library used by the application to interact with the bootloader src/libwolfboot.c

Integrating wolfBoot in an existing project

Required steps

Examples provided

Additional examples available on our GitHub wolfBoot-examples repository here.

The following steps are automated in the default Makefile target, using the baremetal test application as an example to create the factory image. By running make, the build system will:

  • Create a Ed25519 Key-pair using the ed25519_keygen tool
  • Compile the bootloader. The public key generated in the step above is included in the build
  • Compile the firmware image from the test application in test_app
  • Re-link the firmware to change the entry-point to the start address of the primary partition
  • Sign the firmware image using the ed25519_sign tool
  • Create a factory image by concatenating the bootloader and the firmware image

The factory image can be flashed to the target device. It contains the bootloader and the signed initial firmware at the specified address on the flash.

The sign.py tool transforms a bootable firmware image to comply with the firmware image format required by the bootloader.

For detailed information about the firmware image format, see Firmware image

For detailed information about the configuration options for the target system, see Compiling wolfBoot

Upgrading the firmware

  • Compile the new firmware image, and link it so that its entry point is at the start address of the primary partition
  • Sign the firmware using the sign.py tool and the private key generated for the factory image
  • Transfer the image using a secure connection, and store it to the secondary firmware slot
  • Trigger the image swap using libwolfboot wolfBoot_update() function. See wolfBoot library API for a description of the operation
  • Reboot to let the bootloader begin the image swap
  • Confirm the success of the update using libwolfboot wolfBoot_success() function. See wolfBoot library API for a description of the operation

For more detailed information about firmware update implementation, see Firmware Update

Additional features

Troubleshooting

  1. Python errors when signing a key:
Traceback (most recent call last):
  File "tools/keytools/keygen.py", line 135, in <module>
    rsa = ciphers.RsaPrivate.make_key(2048)
AttributeError: type object 'RsaPrivate' has no attribute 'make_key'
Traceback (most recent call last):
  File "tools/keytools/sign.py", line 189, in <module>
    r, s = ecc.sign_raw(digest)
AttributeError: 'EccPrivate' object has no attribute 'sign_raw'

You need to install the latest wolfcrypt-py here: https://github.com/wolfSSL/wolfcrypt-py

Use pip3 install wolfcrypt.

Or to install based on a local wolfSSL installation use:

cd wolfssl
./configure --enable-keygen --enable-rsa --enable-ecc --enable-ed25519 --enable-des3 CFLAGS="-DFP_MAX_BITS=8192 -DWOLFSSL_PUBLIC_MP"
make
sudo make install

cd wolfcrypt-py
USE_LOCAL_WOLFSSL=/usr/local pip3 install .

Release Notes

v1.0 (2018-12-04)

  • Initial release with fail-safe update, HAL support for STM32 and nRF52

V1.1 (2019-03-27)

  • Added support for ECC-256 DSA
  • Added support for external (e.g. SPI) flash for Update/swap
  • Anti-rollback protection via version number
  • Hardware support
    • Added compile options for Cortex-M0
    • new HAL: Atmel SamR21
    • new HAL: TI cc26x2
    • new HAL: NXP/Freescale Kinetis SDK
  • Improved sign/update tools compatibility (windows)

V1.2 (2019-07-30)

  • Added support for multiple architectures
  • key generation and signing tools rewritten in python for portability
  • Added compile-time option to move flash-writing functions to RAM
  • Introduced the possibility for the bootloader to update itself
  • Fixed compile issues on macOS and WSL
  • Hardware support
    • Added RV32 RISC-V architecture
    • Added hardware-assisted dual-bank support on STM32F76x/77x
    • new HAL: RV32 FE310 (SiFive HiFive-1)
    • new HAL: STM32L0
    • new HAL: STM32G0
    • new HAL: STM32F7

V1.3 (2019-11-13)

  • New configuration mechanism based on make config, helps creating and storing target-specific configurations
    • Configuration examples provided for a number of existing platforms
  • fix bug in self-update mechanism when SPI flash is in use
  • Introduced support for hardware-assisted signature verification, using public-key hardware accelerators
    • Added support for STM32 PKA (e.g. STM32WB55)
    • Added support for Kinetis/Freescale PKHA (e.g. Kinetis K82F)

V1.4 (2020-01-06)

  • TPM2.0 support
    • Integration with wolfTPM
    • Extended STM32 SPI driver to support dual TPM/FLASH communication
    • Tested on STM32 with Infineon 9670
  • RSA 2048 bit digital signature verification
  • Hardware support
    • New HAL: STM32H7

V1.5 (2020-04-28)

  • RSA 4096 bit digital signature verification
  • SHA3
  • Portable C key management tools
  • Improved integration with Microsoft Windows
    • Visual Studio solution for key management tools
  • Support to compile with IAR
    • Fixed incompatible code
    • added IAR example project
  • New architecture: ARMv8 (64-bit)
    • ARM Cortex-A boot code compatible with TrustZone
    • Linux staging and device tree support
  • External flash abstraction
    • remote update partition accessed via UART
  • Hardware support
    • New HAL: raspberry-pi
    • New HAL: Xilinx Zynq+
    • New HAL: NXP LPC54xx

V1.6 (2020-08-25)

  • Support for encryption of external partitions
  • Support for MPU on ARM Cortex-M platforms
  • Support for using an RSA signature that includes ASN.1 encoded header
  • Support for bootloader updates from external flash: SPI functions can run from RAM
  • Added TPM RSA verify support
  • Added option to use software SHA in combination with TPM
  • Fix logic in emergency updates
  • Fix loop logic in bootloader update
  • Fix manifest header boundary checks (prevents parser overflows)
  • Improve sanity checks for aligned fields in manifest header
  • Add unit tests against manifest header parser
  • Fix Ed25519 signing tool
  • Fix RSA keygen tool
  • wolfTPM integration: improvements and bugfixes
  • Fix configuration and documentation for STM32WB
  • Fix alignment of trailers in NVM_WRITEONCE mode
  • Fix uint16_t index overflow on platforms with very small flash pages
  • Fix for building C key tools on windows (Cygwin/MinGW/Visual Studio)
  • Fix in LPC driver: correct page alignment in flash write
  • Hardware support
    • New HAL: Cypress psoc6
    • Support for psoc6 Hardware crypto accelerator
    • SPI driver: Nordic nRF52

V1.7.1 (2021-02-03)

  • Added support for measured boot via TPM
  • Support for TZEN on Cortex-m33
  • Added option to disable backup/fallback
  • Added option FLAGS_HOME to store UPDATE flags in the BOOT partition
  • Zynq: added support for eFuse
  • Zynq: improved debugging
  • Xilinx: support for BSP QSPI driver
  • Updated user documentation
  • Extend coverage of automatic non-regression tests running on Jenkins
  • Fix wolfTPM integration: use custom settings
  • Fix Fallback operations when encryption is enabled
  • Fix DUALBANK mode on STM32L5xx
  • Fix maximum image size check
  • Fix in STM32H7 driver: workaround for error correction in flash writing
  • Hardware support
    • New ARCH: ARMv8-m (Cortex-m33)
    • New HAL: STM32L5xx
    • New HAL: NXP iMX-RT1060
    • SPI driver: STM32L0x3
    • Uart driver: STM32L0x3
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].