MCUboot: A Secure Bootloader For Microcontroller-class Devices - - PowerPoint PPT Presentation

mcuboot a secure bootloader for microcontroller class
SMART_READER_LITE
LIVE PREVIEW

MCUboot: A Secure Bootloader For Microcontroller-class Devices - - PowerPoint PPT Presentation

MCUboot: A Secure Bootloader For Microcontroller-class Devices Aditj Hilbert <aditj@runtjme.io> Szymon Janc <szymon.janc@codecoup.pl> September 25, 2017 IoT challenges Small, memory-constrained, low-cost Example hardware:


slide-1
SLIDE 1

September 25, 2017

MCUboot: A Secure Bootloader For Microcontroller-class Devices

Aditj Hilbert <aditj@runtjme.io> Szymon Janc <szymon.janc@codecoup.pl>

slide-2
SLIDE 2

IoT challenges

  • Small, memory-constrained, low-cost
  • Example hardware: 100 MHz, 256 KB of fmash, 32 KB of RAM!
  • Security
  • Millions of connected devices present large attack surface
  • Devices deployed in unprotected areas
  • Scale and Variety
  • Customers want long-term fmexibility in choice of HW and OS

without vendor lock-in

  • Customers need consistent and easy management across the

fmeet

slide-3
SLIDE 3

MCUboot: Features

Goal: Provide the foundation for secure upgrade

  • Image Verifjcation
  • Digital signatures supported: RSA, ECDSA, (soon Ed25519)
  • Two supported upgrade methods:
  • Image swap
  • Overwrite
  • Modular design:
  • Portable across Operating Systems
  • Currently supports Apache Mynewt, Zephyr OS, Riot OS
  • Simple porting layer provided by the OS
  • Uses minimal OS features: fmash driver, single thread, crypto

services

Version 1.0 just released!

slide-4
SLIDE 4

Flash Layout

  • Slot 0: Primary image, code always runs from here
  • Slot 1: New image for upgrade
  • During upgrade, MCUboot swaps slots using scratch
  • Image trailer indicates state of swap and upgrade
  • Image header contains image size and version information

Bootloader Slot 0 Slot 1 Scratch

slide-5
SLIDE 5

Boot Operation

Resuming interrupted swap process? Resuming interrupted swap process? Inspect swap status region Inspect swap status region Complete swap Complete swap Inspect image trailer – swap requested? Inspect image trailer – swap requested? Image signature valid? Image signature valid? Perform swap Perform swap Write swap completjon in image trailer Write swap completjon in image trailer Boot into image in slot 0 Boot into image in slot 0 NO YES YES Erase invalid image Erase invalid image Write swap failure in image trailer Write swap failure in image trailer YES NO

slide-6
SLIDE 6

Tools

  • Newt tool (in Go) from Apache Mynewt
  • Build images
  • Sign images
  • Load
  • Run and debug images
  • Imgtool.py from Linaro
  • keygen: Generate private/public keypairs to use for signing
  • getpub: Extract a public key as C source to be included in bootloader
  • sign: Add a signature to an image
  • Simulator
  • Bootloaders are tricky!
  • Compiles on a host machine along with the simulation
  • Tests various confjguration of images, upgrades and signatures
  • Tests recovery of untimely upgrade interrupts, simulating power loss
  • Run by Travis on every pull request given to github
slide-7
SLIDE 7

Roadmap

  • Support for multiple fmash devices
  • More effjcient crypto libraries, additional signature algorithms
  • More error detection
  • Key invalidation and revocation
  • Abstraction layer to leverage HW-based security (e.g. accelerator,

secure OTP)

  • Additional tools for testing and debugging
  • Porting to additional OS
  • Testing with lots of HW!
slide-8
SLIDE 8

MCUboot: Project Details

  • Has evolved out of the Apache Mynewt bootloader
  • https://github.com/runtimeco/mcuboot
  • Mailing list: dev-mcuboot@lists.runtime.co
  • Slack:

https://join.slack.com/t/mcuboot/shared_invite/ MjE2NDcwMTQ2MTYyLTE1MDA4MTIzNTAtYzgyZTU0NjFkMg

  • Version 1.0 just released!
slide-9
SLIDE 9
  • MCU agnostic: ARM Cortex-M*,

AVR, MIPS, RISC-V

  • Pre-emptive, multi-threaded,

power optimized RTOS

  • Open networking stacks

including BLE host & controller

  • Secure Bootloader and Image

Upgrade

  • Flash fjle systems, console,

sensor framework & more

  • Build & Package Management –

Newt Tool

  • Open Management Interfaces

(e.g., OIC 1.1 / IoTivity)

Secure Bootloader & FFS Secure Bootloader & FFS OS OS HAL HAL

Stats & Logs Stats & Logs Console & Shell Console & Shell Confjg & Upgrad e Confjg & Upgrad e

Networking Networking

Drivers Drivers

Origins of MCUboot: Apache Mynewt

Power Power

Management Management Application Application

Sensor API Sensor API

https://mynewt.apache.org/ Any module can be decoupled and used by other Operating Systems!

slide-10
SLIDE 10

Thank You!