forked from cerc-io/plugeth
Add IsOnCurve check to EC unmarshalling in ECIES decryption
This commit is contained in:
parent
09147a50ed
commit
aa4ff52d84
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user