Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Aug 25, 2023
1 parent a19f693 commit 48e71bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions notation.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func Verify(ctx context.Context, verifier Verifier, repo registry.Repository, ve
logger.Debug("Fetching signature manifests")
err = repo.ListSignatures(ctx, artifactDescriptor, func(signatureManifests []ocispec.Descriptor) error {
// process signatures
for _, sigManifestDesc := range signatureManifests {
for ind, sigManifestDesc := range signatureManifests {
if numOfSignatureProcessed >= verifyOpts.MaxSignatureAttempts {
break
}
Expand All @@ -383,7 +383,7 @@ func Verify(ctx context.Context, verifier Verifier, repo registry.Repository, ve
logger.Error("Got nil outcome. Expecting non-nil outcome on verification failure")
return err
}
outcome.SignatureManifestDescriptor = &sigManifestDesc
outcome.SignatureManifestDescriptor = &signatureManifests[ind]
outcomeCopy := *outcome
verificationOutcomes = append(verificationOutcomes, &outcomeCopy)
continue
Expand All @@ -392,7 +392,7 @@ func Verify(ctx context.Context, verifier Verifier, repo registry.Repository, ve
verificationSucceeded = true
// on success, verificationOutcomes only contains the
// succeeded outcome
outcome.SignatureManifestDescriptor = &sigManifestDesc
outcome.SignatureManifestDescriptor = &signatureManifests[ind]
verificationOutcomes = []*VerificationOutcome{outcome}
logger.Debugf("Signature verification succeeded for artifact %v with signature digest %v", artifactDescriptor.Digest, sigManifestDesc.Digest)

Expand Down

0 comments on commit 48e71bc

Please sign in to comment.