Skip to content

feat: add CLI option to generate dm-verity referrer objects#1343

Draft
dallasd1 wants to merge 5 commits intonotaryproject:mainfrom
dallasd1:dadelan/dm-verity
Draft

feat: add CLI option to generate dm-verity referrer objects#1343
dallasd1 wants to merge 5 commits intonotaryproject:mainfrom
dallasd1:dadelan/dm-verity

Conversation

@dallasd1
Copy link
Copy Markdown
Contributor

  • Add CLI option for --dm-verity to push OCI referrers containing PKCS#7 envelopes and root hashes
  • Add a localPrimitiveSigner for the new dm-verity option
  • Add EROFS package to convert tar.gz blobs
  • add dmverity package to use as a signing wrapper and create new manifests
  • add registryutil package to expose general operations on OCI registry artifacts

dallasd1 and others added 5 commits March 10, 2026 16:47
Add infrastructure for converting OCI layers to EROFS and computing
dm-verity root hashes, with parameters matching containerd's
erofs-snapshotter for compatible hash output.

- internal/erofs/converter.go: tar.gz → EROFS via mkfs.erofs --tar=i
- internal/erofs/veritysetup.go: dm-verity root hash via veritysetup
- internal/registryutil/fetcher.go: OCI registry blob fetcher

Signed-off-by: Dallas Delaney <dadelan@microsoft.com>
Add dm-verity signing mode to 'notation sign'. When --dm-verity is set,
each image layer is converted to EROFS, its dm-verity root hash is
computed, and signed with PKCS#7 using notation-core-go's envelope.
Layer signatures are pushed as an OCI referrer artifact.

For plugins, signing_scheme=rsassa-pkcs1-v1_5 is injected into plugin
config since the Linux kernel only supports PKCS#1 v1.5 verification.

- cmd/notation/sign.go: --dm-verity flag, orchestration, registry push
- cmd/notation/internal/sign/sign.go: GetPrimitiveSigner, localPrimitiveSigner
- internal/dmverity/dmverity.go: layer signing and manifest construction

Signed-off-by: Dallas Delaney <dadelan@microsoft.com>
Signed-off-by: Dallas Delaney <dadelan@microsoft.com>
- Gate --dm-verity behind NOTATION_EXPERIMENTAL=1 enforcement
- Add SecureFlagOpts to dm-verity registry calls
- Change CLI logs from info to debug
- Rename LayerSignature to SignatureEnvelope
- Replace hardcoded empty config with ocispec.DescriptorEmptyJSON

Signed-off-by: Dallas Delaney <dadelan@microsoft.com>
Signed-off-by: Dallas Delaney <106280731+dallasd1@users.noreply.github.com>
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