]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.20] crypto/ecdh: explicitly reject mismatched curves in ECDH
authorRoland Shoemaker <roland@golang.org>
Tue, 31 Jan 2023 17:14:16 +0000 (09:14 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 28 Feb 2023 01:46:26 +0000 (01:46 +0000)
commitaaace6dda7cde2bebf13c64fb0d75536adb2b08b
tree7157ad0180a47d62ef711ba839c5906844c1e86c
parent0f4483cfdcf303ac5cbe4f4536e23750423137d9
[release-branch.go1.20] crypto/ecdh: explicitly reject mismatched curves in ECDH

Return an explicit error when PrivateKey.ECDH is called with a PublicKey
which uses a different Curve. Also document this requirement, even
though it is perhaps obvious.

Updates #58131.
Fixes #58498.

Change-Id: I739181a3f1283bed14fb5ee7eb78658b854d28d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/464335
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
(cherry picked from commit 67d8916d551d22f5376e0be71d3922c9d63eaa6a)
Reviewed-on: https://go-review.googlesource.com/c/go/+/471602
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/crypto/ecdh/ecdh.go
src/crypto/ecdh/ecdh_test.go