-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bug] cosign verify error parsing and output tables (#134)
* fix bug in cosign verify when using kms protocol for keys * modify table row creation for verify signature tables
- Loading branch information
1 parent
0800c90
commit f90ebb9
Showing
3 changed files
with
94 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cosign | ||
|
||
import ( | ||
"errors" | ||
|
||
cosignError "github.com/sigstore/cosign/v2/cmd/cosign/errors" | ||
) | ||
|
||
// isNoMatchingSignatureErr checks if the error is of type ErrNoMatchingSignature | ||
func isNoMatchingSignatureErr(err error) bool { | ||
var ce *cosignError.CosignError | ||
if errors.As(err, &ce) && ce.Code == cosignError.NoMatchingSignature { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
// isImageWithoutSignatureErr checks if the error is of type ErrNoSignaturesFound | ||
func isImageWithoutSignatureErr(err error) bool { | ||
var ce *cosignError.CosignError | ||
if errors.As(err, &ce) && ce.Code == cosignError.ImageWithoutSignature { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
// isNoCertificateFoundOnSignatureErr checks if the error is of type ErrNoCertificateFoundOnSignature | ||
func isNoCertificateFoundOnSignatureErr(err error) bool { | ||
var ce *cosignError.CosignError | ||
if errors.As(err, &ce) && ce.Code == cosignError.NoCertificateFoundOnSignature { | ||
return true | ||
} | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters