]> Cypherpunks repositories - gostls13.git/commit
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>
Mon, 6 Feb 2023 21:22:50 +0000 (21:22 +0000)
commit67d8916d551d22f5376e0be71d3922c9d63eaa6a
tree201dd2d81773ba6c691e348d64652fa124148be9
parente2ca417ee797e1e80d8d395e0f4760416b8346d9
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.

Fixes #58131

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>
src/crypto/ecdh/ecdh.go
src/crypto/ecdh/ecdh_test.go