Repository navigation
Allow SHA-384 and SHA-512 signature algorithms for issuer certs and trust anchors - #15783
Open
aniketatgithub wants to merge 1 commit into
Open
aniketatgithub wants to merge 1 commit into
aniketatgithub wants to merge 1 commit into
Conversation
…rust anchors Problem `linkerd check` fails "issuer cert is using supported crypto algorithm" when the issuer certificate is signed with SHA-384 or SHA-512, for example by a cert-manager RSA-4096 CA, which signs with `SHA512WithRSA`. `checkECDSACertRequirements` only accepted `ECDSAWithSHA256` and `SHA256WithRSA`, and its error message claimed the certificate "must be signed by an ECDSA P-256 key", which is not what it checks. The proxy verifies RSA PKCS#1 and ECDSA signatures with SHA-256, SHA-384 or SHA-512, so identity and mTLS work with such an issuer and only the check stays red. `checkRSACertRequirements` had the same SHA-256-only rule for RSA trust anchors. Solution Accept `ECDSAWithSHA384`, `ECDSAWithSHA512`, `SHA384WithRSA` and `SHA512WithRSA` alongside the SHA-256 algorithms in both checks, through a shared `isSupportedSignatureAlgorithm` helper. The P-256 public key requirement for issuer certificates and the RSA 2048/4096 key-size requirement for trust anchors are unchanged. Error messages now list the accepted hashes, and the stale doc comment on `CheckIssuerCertAlgoRequirements` is corrected. Validation New table tests in `pkg/issuercerts` cover all six accepted algorithms for issuer certificates and RSA trust anchors, plus rejections (SHA-1 signatures, non-P-256 issuer keys, RSA issuer keys). The accept cases fail on unpatched code and pass with the fix. `go test ./pkg/issuercerts/` passes; `gofmt` and `go vet` clean. Fixes linkerd#15782 Signed-off-by: Aniket Kumar Tikariha <aniketkomailkro@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
linkerd checkfails "issuer cert is using supported crypto algorithm" when the issuer certificate is signed with SHA-384 or SHA-512, for example by a cert-manager RSA-4096 CA, which signs withSHA512WithRSA.checkECDSACertRequirementsonly acceptedECDSAWithSHA256andSHA256WithRSA, and its error message claimed the certificate "must be signed by an ECDSA P-256 key", which is not what it checks. The proxy verifies RSA PKCS#1 and ECDSA signatures with SHA-256, SHA-384 or SHA-512, so identity and mTLS work with such an issuer and only the check stays red.checkRSACertRequirementshad the same SHA-256-only rule for RSA trust anchors.Solution
Accept
ECDSAWithSHA384,ECDSAWithSHA512,SHA384WithRSAandSHA512WithRSAalongside the SHA-256 algorithms in both checks, through a sharedisSupportedSignatureAlgorithmhelper. The P-256 public key requirement for issuer certificates and the RSA 2048/4096 key-size requirement for trust anchors are unchanged. Error messages now list the accepted hashes, and the stale doc comment onCheckIssuerCertAlgoRequirementsis corrected.Validation
New table tests in
pkg/issuercertscover all six accepted algorithms for issuer certificates and RSA trust anchors, plus rejections (SHA-1 signatures, non-P-256 issuer keys, RSA issuer keys). The accept cases fail on unpatched code and pass with the fix.go test ./pkg/issuercerts/passes;gofmtandgo vetclean.Fixes #15782
Signed-off-by: Aniket Kumar Tikariha aniketkomailkro@gmail.com