Commit 7c0a18ed authored by Jeffrey Wilcke's avatar Jeffrey Wilcke

Merge pull request #658 from Gustav-Simonsson/add_ec_point_on_curve_check

Add IsOnCurve check to EC unmarshalling in ECIES decryption
parents 09147a50 aa4ff52d
......@@ -303,6 +303,10 @@ func (prv *PrivateKey) Decrypt(rand io.Reader, c, s1, s2 []byte) (m []byte, err
err = ErrInvalidPublicKey
return
}
if !R.Curve.IsOnCurve(R.X, R.Y) {
err = ErrInvalidCurve
return
}
z, err := prv.GenerateShared(R, params.KeyLen, params.KeyLen)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment