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

Snap integrity discover #14873

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

sespiros
Copy link
Contributor

This is currently lacking a few end to end tests so opening as draft.

It is based on top of:

and adds a single commit on top which enables snap-bootstrap to use the new APIs in order to mount snaps coming from the seed with dm-verity data.

Jira: https://warthogs.atlassian.net/browse/FR-9883

checkDigestWhatDec also accepts a function used for the decoding.
…y stanza

With the new design, dm-verity data can be generated on installation
using the parameters from the snap-revision assertion which also
contains the dm-verity root hash.

Multiple variants of integrity data are possible for a single
snap-revision to allow for future per-device optimization and
configuration.
Under the new design, generating dm-verity data via `snap pack` is
not needed as support for integrity data was simplified and there is
no extra logic or separate header anymore.
…format

also dmverity.Format will simply return the root hash instead of the old
Info struct since the new design doesn't have a need for a separate header.
adding helpers for retrieving and parsing a dm-verity superblock from a
dm-verity hash device/file. This will be first consumed by the snap
integrity API which will need to detect the salt that was used for the
dm-verity data generation. Moreover callers to dmverity.Format will
need to have a way to retrieve the parameters used by veritysetup if
no parameters are passed (and veritysetup chooses default values).
the new design simplifies how snap dm-verity data for a corresponding
snap are generated and used by having them as a separate file (i.e
located next to the snap file) instead of attaching them at the end of
their snap file by default.

The extra integrity data header is removed as all the information
needed to mount a snap with its verity data (root hash, salt, other
parameters) will be retrieved from a new integrity stanza in
snap-revision assertions.
* snap-integrity-new-api:
  s/integrity: rework snap integrity API
  snap/integrity: add default dmverity format version
  s/i/dmverity/veritysetup: add superblock parsing functionality
  s/i/dmverity/veritysetup: add ability to pass options to veritysetup format
  s/i/dmverity: refactor getRootHashFromOutput
* snap-integrity-remove-pack:
  multiple: remove dm-verity support from snap pack
This commit adds support for looking up dm-verity integrity data
for asserted snaps in the seed (ones that have verified assertions
available).

snap-bootstrap can then use these integrity data parameters to call to
the snap integrity API in order to either detect available dm-verity
hash data or generate them. It will then proceed with mounting the
snaps using dm-verity.
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.

1 participant