Skip to content

Commit

Permalink
Introduce acceptableCert
Browse files Browse the repository at this point in the history
Finally, only create the verifier based on an actually acceptable certificate,
instead of creating it first and then hoping not to forget to validate preconditions.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Dec 7, 2022
1 parent 2c2f0da commit 36f9fa1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cosign/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,9 @@ func verifyInternal(ctx context.Context, untrustedSignature oci.Signature, h v1.
return false, fmt.Errorf("checking expiry on cert: %w", err)
}
}
acceptableCert := certWithUnverifiedExpiry

verifier, err = verifierFromTrustedCertificate(certWithUnverifiedExpiry)
verifier, err = verifierFromTrustedCertificate(acceptableCert)
if err != nil {
return false, err
}
Expand Down

0 comments on commit 36f9fa1

Please sign in to comment.