Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include device app binaries and use tkey-device-signer #19

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

mchack-work
Copy link
Member

@mchack-work mchack-work commented Apr 18, 2024

Very much WIP!

Based on use_tkeylibs branch.

We use the ordinary tkeysign package to communicate with signer and the old verisigner.

We move some internal packages under tkey-verification because they're not needed anywhere else.

Instead of using some global variables we use NewFoo() and return an object we work on.

NewAppBins() sets upp all of our embedded device apps.

NewVendorKeys() does the same with our vendor keys (plural) which means we also support more than one vendor key. This might be necessary if we're going to use the plain signer in the vendor signing going forward, since we already have a different published vendor key.

Closes #18

@mchack-work mchack-work requested a review from dehanj April 18, 2024 10:09
- tkeyclient instead of old tk1
- tkeysign instead of tk1sign

Digests as strings
Use NewFirmwares() and the methods on the object returned from that.
Remove use of devPath in most functions and instead open a TKey
connection and re-use that during the operations.
@dehanj dehanj mentioned this pull request May 17, 2024
First stab at updating documentation for the refacotoring
os.Exit(code)
}

fmt.Printf("tk: %#v\n", tk)
Copy link
Member

Choose a reason for hiding this comment

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

Is this a leftover debug print?

mchack-work and others added 10 commits May 23, 2024 22:33
- Remove install targets. To Linux and dist specific.
- Remove appbins-from-tags: We include the app binaries instead.
- Remove show-pubkey: We move it inside tkey-verification.
- Build static binary of client app, make it reproducible.
- Add a podman target.
- Add check-digest target to check device app digests.
- Run Go lint tools and expect the tools to be already installed.
- Split remoteSign() into several functions
- As an effect, introduce new command sign-challenge to only do the
  signing of the challenge part of the remote-sign flow.
- loadRemoteSignConfig() now returns Server instead of Config, setting
  up a TLS config in there.
- Skip passing checkConfigOnly to remoteSign(). Handle in main.go.
- Turn many exits to return errors.
The show-pubkey command outputs the vendor signing pubkey, the app
tag, and app hash digest to stdout. The output is in the format used
for a line in the vendor-signing-pubkey.txt file, and used to embed
another vendor signing key.

The command takes takes an argument with the path to the devie app
using --app path/to/app.bin
- Use gon for signing.
- Skip test for homebrew formula for now.
- Tkeyclient does not support building static binaries for Darwin, it
  requires CGO to enable enumeration of connected serial devices. In the
  short term we enable CGO for Darwin before we can find another
  reliable solution. See issue #13.
mchack-work and others added 10 commits May 23, 2024 22:34
It contains a lock and should be passed by reference instead of by
value.
We haven't decided on the use of depguard gci, or gufumpt yet.
- Verisigner is deprecated for the use of tkey-device-signer, hence it
  is removed in this repo - but still buildable if checking out a
  verisigner tag.
- The binaries are not included in the repo.
- Remove the builds scripts associated with verisigner.
- Changes to readme to reflect.
dehanj and others added 6 commits May 23, 2024 22:48
Instead of initializing all of:

- vendor keys
- app binaries
- known firmwares

at start regardless of what command is given on the command line, we
do only the initialization we need for the specific command given.

This also means we can't report what exactly everything is built with
without initializing so we introduce a new function
util.go:builtWith() which does this for us.
- We move the error handling to their own file.
- Expand the constant error list with the UDI errors.
- Complex errors get their own type.
- Remove man page in mdoc in system/
- Add scdoc file in doc/.
- Add make target to generate manual page from scdoc.
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.

Use tkey-device-signer, include binaries in repo
2 participants