Skip to content

Conversation

@lsm5
Copy link
Member

@lsm5 lsm5 commented Nov 26, 2025

Add a new manifest.DigestWithAlgorithm function that
allows computing the digest of a manifest using a specified algorithm
(e.g., SHA256, SHA512) while properly handling v2s1 signed manifest
signature stripping.

This addresses the need for skopeo's --manifest-digest flag to support
different digest algorithms while correctly handling all manifest types,
particularly Docker v2s1 signed manifests that require signature
stripping before digest computation.

Note: Currently rebased on #475 .

lsm5 added 2 commits November 26, 2025 14:23
When storing blobs with non-canonical digest algorithms (e.g., sha512),
store the blob under the provided digest algorithm with an algorithm
prefix (e.g., "sha512-abc" instead of just "abc").

SHA256 (canonical) digests continue to be stored without a prefix for
backward compatibility.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
Introduce version 1.2 and dynamically assign versions based on the digest
algorithms used:
- Version 1.1 for sha256-only images (backward compatibility)
- Version 1.2 for images using non-sha256 digest algorithms (e.g., sha512)

Add validation in both ImageDestination and ImageSource to:
- Assume 1.1 if no version file found in dir transport images
- Accept both version 1.1 and 1.2
- Refuse unsupported future versions

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
@github-actions github-actions bot added the image Related to "image" package label Nov 26, 2025
Add a new `manifest.DigestWithAlgorithm` function that
allows computing the digest of a manifest using a specified algorithm
(e.g., SHA256, SHA512) while properly handling v2s1 signed manifest
signature stripping.

This addresses the need for skopeo's `--manifest-digest` flag to support
different digest algorithms while correctly handling all manifest types,
particularly Docker v2s1 signed manifests that require signature
stripping before digest computation.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
@lsm5 lsm5 force-pushed the digest-redux-manifest branch from e1149c9 to bdbac34 Compare November 26, 2025 19:40
@lsm5 lsm5 changed the title manifest: Add DigestWithAlgorithm function image/manifest: Add DigestWithAlgorithm function Nov 26, 2025
@packit-as-a-service
Copy link

Packit jobs failed. @containers/packit-build please check.

podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Nov 26, 2025
@podmanbot
Copy link

✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

image Related to "image" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants