Skip to content

Lock down vendor pubkey - #35

Merged
mchack-work merged 4 commits into
mainfrom
lock-pubkey
Jun 23, 2026
Merged

Lock down vendor pubkey#35
mchack-work merged 4 commits into
mainfrom
lock-pubkey

Conversation

@mchack-work

@mchack-work mchack-work commented Jun 17, 2026

Copy link
Copy Markdown
Member

Description

Instead of letting anyone update the vendor pubkey on the filesystem, only update it if a signature over the new pubkey is provided.

  • Update the CMD_STORE_PUBKEY protocol request to:

    • 32 bytes pubkey
    • 64 bytes Ed25519 signature
  • Update tkey-mgt to read in both public key and signature when used with the "install-pubkey" command.

  • Update the boot verifier itself to verify the Ed25519 signature before allowing the vendor public key to be updated.

  • Add -P to sign-tool to export a public key in binary form. Necessary to sign a pubkey.

  • Tap only 1 time for vendor pubkey update since it's checked if it's verified.

NOTE WELL: So far no check is done in boot verifier when updating an app if the vendor pubkey on the filesystem will verify it. See #37

Type of change

  • Breaking Change (a change which would cause existing functionality to not work as expected)
  • Documentation (a change to documentation)

Submission checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my changes
  • I have tested and verified my changes on target
  • My changes are well written and CI is passing
  • I have squashed my work to relevant commits and rebased on main for linear history
  • I have added a "Co-authored-by: x" if several people contributed, either pair programming or by squashing commits from different authors.
  • I have updated the documentation where relevant (readme, dev.tillitis.se etc.)
  • QEMU is updated to reflect changes

@agren agren left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through this draft PR as it is at this moment. I realize you might have already addressed some of the things I'm commenting on.

Comment thread verifier/pubkey.c
Comment thread README.md Outdated
Comment thread verifier/pubkey.c Outdated

@agren agren left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested on hardware and it works. Have only some minor notes.

Comment thread README.md Outdated
Comment thread cmd/sign-tool/sign-tool.go
Instead of letting anyone update the vendor pubkey on the filesystem,
only update it if a signature over a digest of the new pubkey is
provided.

- Update the CMD_STORE_PUBKEY protocol request to:

  - 32 bytes pubkey
  - 64 bytes Ed25519 signature

- Update tkey-mgt to read in both public key and signature when used
  with the "install-pubkey" command.

- Update the boot verifier itself to compute a digest over the new
  pubkey and verify the Ed25519 signature before allowing the
  key to be updated.

- Break out stuff to util.[ch]
In some cases we want the user to tap 3 times to assert presence and
sometimes just one.
To be able to sign a binary public key, add -P to export to a binary
file.

Update usage text.
@mchack-work
mchack-work merged commit 19c8659 into main Jun 23, 2026
2 checks passed
@mchack-work
mchack-work deleted the lock-pubkey branch June 23, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants