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

PKI: Add support for signature_bits param to the intermediate/generate api #17388

Merged
merged 3 commits into from
Oct 3, 2022

Conversation

stevendpclark
Copy link
Contributor

  • Mainly to work properly with GCP backed managed keys, we need to issue signatures that would match the GCP key algorithm.

  • At this time due to crypto/x509: can't verify signature on RSA-PSS certificate requests it created golang/go#45990 we can't issue PSS signed CSRs, as the libraries in Go always request a PKCS1v15.

  • Add an extra check in intermediate/generate that validates the CSR's signature before providing it back to the client in case we generated a bad signature such as if an end-user used a GCP backed managed key with a RSA PSS algorithm.

    • GCP ignores the requested signature type and always signs with the key's algorithm which can lead to a CSR that says it is signed with a PKCS1v15 algorithm but is actually a RSA PSS signature

…e api

 - Mainly to work properly with GCP backed managed keys, we need to
   issue signatures that would match the GCP key algorithm.
 - At this time due to golang/go#45990 we
   can't issue PSS signed CSRs, as the libraries in Go always request
   a PKCS1v15.
 - Add an extra check in intermediate/generate that validates the CSR's
   signature before providing it back to the client in case we generated
   a bad signature such as if an end-user used a GCP backed managed key
   with a RSA PSS algorithm.
   - GCP ignores the requested signature type and always signs with the
     key's algorithm which can lead to a CSR that says it is signed with
     a PKCS1v15 algorithm but is actually a RSA PSS signature
Copy link
Contributor

@cipherboy cipherboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit about CheckSignature location and a minor docs clarification I think

website/content/docs/secrets/pki/considerations.mdx Outdated Show resolved Hide resolved
builtin/logical/pki/path_intermediate.go Outdated Show resolved Hide resolved
requireED25519SignedBy(t, cert, typedKey)
default:
require.Fail(t, "unknown public key type %#v", key)
func requireSignedBy(t *testing.T, cert *x509.Certificate, signingCert *x509.Certificate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 -- I had thought of this change a while ago, but never actually submitted it, thank you!

Copy link
Contributor

@cipherboy cipherboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants