mirror of
https://github.com/containers/skopeo.git
synced 2025-09-03 23:55:21 +00:00
Update module github.com/containers/image/v5 to v5.26.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
7
vendor/github.com/sigstore/rekor/pkg/util/checkpoint.go
generated
vendored
7
vendor/github.com/sigstore/rekor/pkg/util/checkpoint.go
generated
vendored
@@ -25,7 +25,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/trillian/types"
|
||||
"github.com/sigstore/sigstore/pkg/signature"
|
||||
"github.com/sigstore/sigstore/pkg/signature/options"
|
||||
)
|
||||
@@ -168,11 +167,11 @@ func (r *SignedCheckpoint) GetTimestamp() uint64 {
|
||||
}
|
||||
|
||||
// CreateAndSignCheckpoint creates a signed checkpoint as a commitment to the current root hash
|
||||
func CreateAndSignCheckpoint(ctx context.Context, hostname string, treeID int64, root *types.LogRootV1, signer signature.Signer) ([]byte, error) {
|
||||
func CreateAndSignCheckpoint(ctx context.Context, hostname string, treeID int64, treeSize uint64, rootHash []byte, signer signature.Signer) ([]byte, error) {
|
||||
sth, err := CreateSignedCheckpoint(Checkpoint{
|
||||
Origin: fmt.Sprintf("%s - %d", hostname, treeID),
|
||||
Size: root.TreeSize,
|
||||
Hash: root.RootHash,
|
||||
Size: treeSize,
|
||||
Hash: rootHash,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating checkpoint: %v", err)
|
||||
|
23
vendor/github.com/sigstore/sigstore/pkg/signature/payload/payload.go
generated
vendored
23
vendor/github.com/sigstore/sigstore/pkg/signature/payload/payload.go
generated
vendored
@@ -52,16 +52,32 @@ type Image struct {
|
||||
|
||||
// Cosign describes a container image signed using Cosign
|
||||
type Cosign struct {
|
||||
Image name.Digest
|
||||
Annotations map[string]interface{}
|
||||
Image name.Digest
|
||||
// ClaimedIdentity is what the signer claims the image to be; usually a registry.com/…/repo:tag, but can also use a digest instead.
|
||||
// ALMOST ALL consumers MUST verify that ClaimedIdentity in the signature is correct given how user refers to the image;
|
||||
// e.g. if the user asks to access a signed image example.com/repo/mysql:3.14,
|
||||
// it is ALMOST ALWAYS necessary to validate that ClaimedIdentity = example.com/repo/mysql:3.14
|
||||
//
|
||||
// Considerations:
|
||||
// - The user might refer to an image using a digest (example.com/repo/mysql@sha256:…); in that case the registry/…/repo should still match
|
||||
// - If the image is multi-arch, ClaimedIdentity usually refers to the top-level multi-arch image index also on the per-arch images
|
||||
// (possibly even if ClaimedIdentity contains a digest!)
|
||||
// - Older versions of cosign generate signatures where ClaimedIdentity only contains a registry/…/repo ; signature consumers should allow users
|
||||
// to determine whether such images should be accepted (and, long-term, the default SHOULD be to reject them)
|
||||
ClaimedIdentity string
|
||||
Annotations map[string]interface{}
|
||||
}
|
||||
|
||||
// SimpleContainerImage returns information about a container image in the github.com/containers/image/signature format
|
||||
func (p Cosign) SimpleContainerImage() SimpleContainerImage {
|
||||
dockerReference := p.Image.Repository.Name()
|
||||
if p.ClaimedIdentity != "" {
|
||||
dockerReference = p.ClaimedIdentity
|
||||
}
|
||||
return SimpleContainerImage{
|
||||
Critical: Critical{
|
||||
Identity: Identity{
|
||||
DockerReference: p.Image.Repository.Name(),
|
||||
DockerReference: dockerReference,
|
||||
},
|
||||
Image: Image{
|
||||
DockerManifestDigest: p.Image.DigestStr(),
|
||||
@@ -98,6 +114,7 @@ func (p *Cosign) UnmarshalJSON(data []byte) error {
|
||||
return fmt.Errorf("could not parse image digest string %q: %w", digestStr, err)
|
||||
}
|
||||
p.Image = digest
|
||||
p.ClaimedIdentity = simple.Critical.Identity.DockerReference
|
||||
p.Annotations = simple.Optional
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user