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

Fixing issue 3669 #3670

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions pkg/cosign/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,19 +608,27 @@ func verifySignatures(ctx context.Context, sigs oci.Signatures, h v1.Hash, co *C
t := throttler.New(workers, len(sl))
for i, sig := range sl {
go func(sig oci.Signature, index int) {
sig, err := static.Copy(sig)
gotMT, err := sig.MediaType()
if err != nil {
t.Done(err)
}
if gotMT != types.SimpleSigningMediaType {
t.Done(errors.New("Incorrect MediaType of Signature"))
return
}
sigNew, err := static.Copy(sig)
if err != nil {
t.Done(err)
return
}

verified, err := VerifyImageSignature(ctx, sig, h, co)
verified, err := VerifyImageSignature(ctx, sigNew, h, co)
bundlesVerified[index] = verified
if err != nil {
t.Done(err)
return
}
signatures[index] = sig
signatures[index] = sigNew

t.Done(nil)
}(sig, i)
Expand Down Expand Up @@ -665,7 +673,6 @@ func verifyInternal(ctx context.Context, sig oci.Signature, h v1.Hash,
verifyFn signatureVerificationFn, co *CheckOpts) (
bundleVerified bool, err error) {
var acceptableRFC3161Time, acceptableRekorBundleTime *time.Time // Timestamps for the signature we accept, or nil if not applicable.

acceptableRFC3161Timestamp, err := VerifyRFC3161Timestamp(sig, co)
if err != nil {
return false, fmt.Errorf("unable to verify RFC3161 timestamp bundle: %w", err)
Expand Down
Loading