Support external firmware signing

Open
#268 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp

Research direction

Start by locating the implementations of the picotool seal and info commands, then review how hashed images, HASH_VALUE items, and existing signing inputs are handled. Done means seal -sign accepts an external public key and signature for a previously hashed image, replaces HASH_VALUE with SIGNATURE, and optionally info -h prints the image hash.

Written by the indexing model from the issue text.

Description

It would be nice to use picotool for signing firmware images without exposing the private key. I imagine the following flow:

$ picotool seal -hash firmware.uf2 firmware.hashed.uf2
$ export HASH=`picotool info -h firmware.hashed.uf2`      # add a -h flag to dump the hash, otherwise `picotool -m firmware.hashed.uf2|grep ...`
$ export SIGNATURE=... # Externally sign $HASH.
$ picotool seal -sign -signature "$SIGNATURE" -pubkey $PUBKEY firmware.hashed.uf2 firmware.signed.uf2

In other words, add support for an externally supplied public key and signature to picotool seal -sign, to convert a previously hashed image to a signed image by replacing its HASH_VALUE item with a SIGNATURE item. Optionally, add a picotool info -h for convenient dumping of a firmware image hash.

This is a generalization of #198 .

Dominant language
C++
Stars
999
Forks
189
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/picotool

All issues in raspberrypi/picotool

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.