-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add signature algorithm to template during certificate creation #1929
base: main
Are you sure you want to change the base?
Add signature algorithm to template during certificate creation #1929
Conversation
Signed-off-by: Horiodino <[email protected]>
…date test cases Signed-off-by: Horiodino <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good overall! We need to also invoke it wherever we call x509.CreateCertificate
, like in
fulcio/pkg/ca/baseca/baseca.go
Line 60 in 260872d
finalCertBytes, err := x509.CreateCertificate(rand.Reader, cert, certChain[0], publicKey, privateKey) |
pkg/ca
.
pkg/certmaker/certmaker.go
Outdated
@@ -522,3 +541,47 @@ func ValidateKMSConfig(config KMSConfig) error { | |||
|
|||
return nil | |||
} | |||
|
|||
// ToSignatureAlgorithm returns the x509.SignatureAlgorithm for the given signer and hash algorithm. | |||
func ToSignatureAlgorithm(signer crypto.Signer, hash crypto.Hash) (x509.SignatureAlgorithm, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to https://github.com/sigstore/fulcio/blob/main/pkg/ca/common.go?
For context, pkg/certmaker
was just added to support a new CLI utility, and I'd prefer to add new functions to it that are only used by the utility.
We should still keep the places above where you updated tmpl.SignatureAlgorithm
though, that LGTM.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1929 +/- ##
==========================================
- Coverage 57.93% 52.30% -5.63%
==========================================
Files 50 73 +23
Lines 3119 5695 +2576
==========================================
+ Hits 1807 2979 +1172
- Misses 1154 2439 +1285
- Partials 158 277 +119 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Horiodino <[email protected]>
Summary
Added ToSignatureAlgorithm to support specifying non-default hash algorithms during certificate creation
#1161
Release Note
Documentation