Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway committed Dec 14, 2024
1 parent 2678134 commit d5ca305
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmd/cosign/cli/verify/verify_bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ func verifyNewBundle(ctx context.Context, bundlePath, trustedRootPath, keyRef, s
// Check if artifactRef is a digest or a file path
var artifactOpt verify.ArtifactPolicyOption
if _, err := os.Stat(artifactRef); err != nil {
if hexAlg, hexDigest, ok := strings.Cut(artifactRef, ":"); !ok {
hexAlg, hexDigest, ok := strings.Cut(artifactRef, ":")
if !ok {
return nil, err
}
digestBytes, err := hex.DecodeString(hexDigest)
if err != nil {
return nil, err
} else {
digestBytes, err := hex.DecodeString(hexDigest)
if err != nil {
return nil, err
}
artifactOpt = verify.WithArtifactDigest(hexAlg, digestBytes)
}
artifactOpt = verify.WithArtifactDigest(hexAlg, digestBytes)
} else {
// Perform verification
payload, err := payloadBytes(artifactRef)
Expand Down

0 comments on commit d5ca305

Please sign in to comment.