Skip to content

Commit

Permalink
Fixes sigstore#3236, disable SCT checking for a cosign verification w…
Browse files Browse the repository at this point in the history
…hen usin… (sigstore#3237)

* Fixes sigstore#3236, disable SCT checking for a cosign verification when using a public key

Signed-off-by: John Kjell <john@testifysec.com>

* Update additional verify functionality

Signed-off-by: John Kjell <john@testifysec.com>

---------

Signed-off-by: John Kjell <john@testifysec.com>
  • Loading branch information
jkjell authored and lance committed Sep 25, 2023
1 parent 51087ce commit 40eda2e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cmd/cosign/cli/verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ func (c *VerifyCommand) Exec(ctx context.Context, images []string) (err error) {
keyRef := c.KeyRef
certRef := c.CertRef

if !c.IgnoreSCT {
// Ignore Signed Certificate Timestamp if the flag is set or a key is provided
if !c.IgnoreSCT || keyRef != "" {
co.CTLogPubKeys, err = cosign.GetCTLogPubs(ctx)
if err != nil {
return fmt.Errorf("getting ctlog public keys: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion cmd/cosign/cli/verify/verify_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ func (c *VerifyAttestationCommand) Exec(ctx context.Context, images []string) (e
if c.CheckClaims {
co.ClaimVerifier = cosign.IntotoSubjectClaimVerifier
}
if !c.IgnoreSCT {
// Ignore Signed Certificate Timestamp if the flag is set or a key is provided
if !c.IgnoreSCT || c.KeyRef != "" {
co.CTLogPubKeys, err = cosign.GetCTLogPubs(ctx)
if err != nil {
return fmt.Errorf("getting ctlog public keys: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion cmd/cosign/cli/verify/verify_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ func (c *VerifyBlobCmd) Exec(ctx context.Context, blobRef string) error {
opts = append(opts, static.WithCertChain(certPEM, chainPEM))
}

if !c.IgnoreSCT {
// Ignore Signed Certificate Timestamp if the flag is set or a key is provided
if !c.IgnoreSCT || c.KeyRef != "" {
co.CTLogPubKeys, err = cosign.GetCTLogPubs(ctx)
if err != nil {
return fmt.Errorf("getting ctlog public keys: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion cmd/cosign/cli/verify/verify_blob_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ func (c *VerifyBlobAttestationCommand) Exec(ctx context.Context, artifactPath st
}
}
}
if !c.IgnoreSCT {
// Ignore Signed Certificate Timestamp if the flag is set or a key is provided
if !c.IgnoreSCT || c.KeyRef != "" {
co.CTLogPubKeys, err = cosign.GetCTLogPubs(ctx)
if err != nil {
return fmt.Errorf("getting ctlog public keys: %w", err)
Expand Down

0 comments on commit 40eda2e

Please sign in to comment.