diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-08 06:51:12 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-08 06:51:12 +0800 |
commit | 7c0a18edb58c46a68bdf524dc2bf3e7edf61dba2 (patch) | |
tree | 2cdd30c902903c178163e12bcebd662477f3187d | |
parent | 09147a50ede8c85022d115e23bb2ce067a50c8de (diff) | |
parent | aa4ff52d84b525f682dd00d231e57284f4735b5a (diff) | |
download | go-tangerine-7c0a18edb58c46a68bdf524dc2bf3e7edf61dba2.tar go-tangerine-7c0a18edb58c46a68bdf524dc2bf3e7edf61dba2.tar.gz go-tangerine-7c0a18edb58c46a68bdf524dc2bf3e7edf61dba2.tar.bz2 go-tangerine-7c0a18edb58c46a68bdf524dc2bf3e7edf61dba2.tar.lz go-tangerine-7c0a18edb58c46a68bdf524dc2bf3e7edf61dba2.tar.xz go-tangerine-7c0a18edb58c46a68bdf524dc2bf3e7edf61dba2.tar.zst go-tangerine-7c0a18edb58c46a68bdf524dc2bf3e7edf61dba2.zip |
Merge pull request #658 from Gustav-Simonsson/add_ec_point_on_curve_check
Add IsOnCurve check to EC unmarshalling in ECIES decryption
-rw-r--r-- | crypto/ecies/ecies.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/ecies/ecies.go b/crypto/ecies/ecies.go index 18952fc0b..812545631 100644 --- a/crypto/ecies/ecies.go +++ b/crypto/ecies/ecies.go @@ -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 { |