Skip to content

Commit

Permalink
verify-blob: make the signature flag mandatory (#1045)
Browse files Browse the repository at this point in the history
Before this commit, the verify-blob command would fail ungracefully in experimental mode
if no signature has been provided. This commit adds a better fitting error message.

Signed-off-by: Christian Rebischke <[email protected]>
  • Loading branch information
shibumi authored Nov 12, 2021
1 parent 6ed55d6 commit cd7e6a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/cosign/cli/verify/verify_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func VerifyBlobCmd(ctx context.Context, ko sign.KeyOpts, certRef, sigRef, blobRe
}

var b64sig string
if sigRef == "" {
return fmt.Errorf("missing flag '--signature'")
}
targetSig, err := blob.LoadFileOrURL(sigRef)
if err != nil {
if !os.IsNotExist(err) {
Expand Down

0 comments on commit cd7e6a8

Please sign in to comment.