Skip to content
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

Allowing specifying signing algorithm for depot signer #221

Merged
merged 3 commits into from
Dec 1, 2023

Conversation

venkyg-sec
Copy link
Contributor

@venkyg-sec venkyg-sec commented Sep 7, 2023

[x] Summary
While creating the x509 template for signing certificates, the depot signer specifies the signing algorithm as picked from the x509 CSR. This assumption is incorrect because the CA key type will not always match the requestor's key type. In addition, the signing algorithm in the CSR is for generally for the verifier to know what algorithm is to be used to verify the CSR signature. While the algorithm to be used to sign the actual certificate is more of a CA/Signer property.

This PR retains the existing behavior but allows overrides for consumers of the depot library.

[x] Test

[scep]$ make test
go test -cover ./...
?   	github.com/micromdm/scep/v2/challenge/bolt	[no test files]
?   	github.com/micromdm/scep/v2/client	[no test files]
ok  	github.com/micromdm/scep/v2/challenge	(cached)	coverage: 85.7% of statements
?   	github.com/micromdm/scep/v2/cmd/scepclient	[no test files]
?   	github.com/micromdm/scep/v2/cmd/scepserver	[no test files]
ok  	github.com/micromdm/scep/v2/cryptoutil	(cached)	coverage: 80.0% of statements
ok  	github.com/micromdm/scep/v2/cryptoutil/x509util	(cached)	coverage: 44.9% of statements
?   	github.com/micromdm/scep/v2/csrverifier	[no test files]
?   	github.com/micromdm/scep/v2/depot	[no test files]
?   	github.com/micromdm/scep/v2/csrverifier/executable	[no test files]
ok  	github.com/micromdm/scep/v2/depot/bolt	(cached)	coverage: 55.8% of statements
?   	github.com/micromdm/scep/v2/depot/file	[no test files]
ok  	github.com/micromdm/scep/v2/scep	(cached)	coverage: 60.2% of statements
ok  	github.com/micromdm/scep/v2/server	0.207s	coverage: 44.9% of statements

depot/signer.go Outdated Show resolved Hide resolved
Co-authored-by: Jesse Peterson <[email protected]>
@jessepeterson jessepeterson merged commit 1ff3fe2 into micromdm:main Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants