Skip to content

Commit

Permalink
make VerifyImageAttestation function public (#3156)
Browse files Browse the repository at this point in the history
Signed-off-by: Priya Wadhwa <[email protected]>
  • Loading branch information
priyawadhwa authored Aug 3, 2023
1 parent 84290f4 commit 46a0b1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/cosign/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ func verifySignatures(ctx context.Context, sigs oci.Signatures, h v1.Hash, co *C
t.Done(err)
return
}

verified, err := VerifyImageSignature(ctx, sig, h, co)
bundlesVerified[index] = verified
if err != nil {
Expand Down Expand Up @@ -907,7 +908,7 @@ func VerifyImageAttestations(ctx context.Context, signedImgRef name.Reference, c
return nil, false, err
}

return verifyImageAttestations(ctx, atts, h, co)
return VerifyImageAttestation(ctx, atts, h, co)
}

// VerifyLocalImageAttestations verifies attestations from a saved, local image, without any network calls,
Expand Down Expand Up @@ -953,15 +954,15 @@ func VerifyLocalImageAttestations(ctx context.Context, path string, co *CheckOpt
if err != nil {
return nil, false, err
}
return verifyImageAttestations(ctx, atts, h, co)
return VerifyImageAttestation(ctx, atts, h, co)
}

func VerifyBlobAttestation(ctx context.Context, att oci.Signature, h v1.Hash, co *CheckOpts) (
bool, error) {
return verifyInternal(ctx, att, h, verifyOCIAttestation, co)
}

func verifyImageAttestations(ctx context.Context, atts oci.Signatures, h v1.Hash, co *CheckOpts) (checkedAttestations []oci.Signature, bundleVerified bool, err error) {
func VerifyImageAttestation(ctx context.Context, atts oci.Signatures, h v1.Hash, co *CheckOpts) (checkedAttestations []oci.Signature, bundleVerified bool, err error) {
sl, err := atts.Get()
if err != nil {
return nil, false, err
Expand Down

0 comments on commit 46a0b1c

Please sign in to comment.