Elliptic curve arithmetic only makes sense between points that belong to
authortb <tb@openbsd.org>
Sun, 2 Sep 2018 17:20:31 +0000 (17:20 +0000)
committertb <tb@openbsd.org>
Sun, 2 Sep 2018 17:20:31 +0000 (17:20 +0000)
commit4d8ec289925e296c40f515cfd82d215f00addf8f
treef77f48bc1b5f9b5390d8d0361d526368e431d722
parent61f7553ff121b430f8ee8c4a88ad2cda2a00a277
Elliptic curve arithmetic only makes sense between points that belong to
the same curve. Some Wycheproof tests violate this assumption, making
ECDH_compute_key() compute and return garbage. Check that pub_key lies
on the curve of the private key so that the calculations make sense.
Most paths that get here have this checked (in particular those from
OpenSSH and libssl), but one might get here after using d2i_* or manual
computation.

discussed with & ok jsing;
"good catch!" markus
lib/libcrypto/ecdh/ech_key.c