x/crypto/ssh: validate DSA parameters in ParseDSAPrivateKey#365
Conversation
|
This PR (HEAD: 52ec342) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/crypto/+/801440. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/801440. |
|
Message from Nicola Murino: Patch Set 2: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/801440. |
|
Message from Nicola Murino: Patch Set 2: Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/801440. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2026-07-19T12:32:16Z","revision":"f74ba3f0fc64327514aafcfaa9e8f5c762a54654"} Please don’t reply on this GitHub thread. Visit golang.org/cl/801440. |
|
Message from Nicola Murino: Patch Set 2: -Commit-Queue (Performed by <GERRIT_ACCOUNT_60063> on behalf of <GERRIT_ACCOUNT_35201>) Please don’t reply on this GitHub thread. Visit golang.org/cl/801440. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: This CL has passed the run Please don’t reply on this GitHub thread. Visit golang.org/cl/801440. |
|
Message from golang-scoped@luci-project-accounts.iam.gserviceaccount.com: Patch Set 2: LUCI-TryBot-Result+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/801440. |
|
This PR (HEAD: 85fd16f) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/crypto/+/801440. Important tips:
|
|
This PR (HEAD: 86cf48c) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/crypto/+/801440. Important tips:
|
1177747 to
7994d3a
Compare
ParseDSAPrivateKey constructed a *dsa.PrivateKey without validating the DSA parameters, unlike the public-key path (parseDSA). A maliciously crafted key with an oversized Q or out-of-range Y/X could slow signing or verification. Apply checkDSAParams and range-check Y and X, matching the public-key path. This is a backward-incompatible change: the key must use parameter size L1024N160, so keys with other parameter sizes (for example a 2048-bit DSA key) that previously parsed now fail at parse time. Such keys could never become a usable SSH signer, matching NewSignerFromKey.
|
This PR (HEAD: 7994d3a) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/crypto/+/801440. Important tips:
|
7994d3a to
140584d
Compare
|
This PR (HEAD: 140584d) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/crypto/+/801440. Important tips:
|
ParseDSAPrivateKey constructed a *dsa.PrivateKey without validating the
DSA parameters, unlike the public-key path (parseDSA). A maliciously
crafted key with an oversized Q or out-of-range Y/X could slow signing
or verification. Apply checkDSAParams and range-check Y (matching the
public-key path) and X (the private key value).
Fixes golang/go#80418