mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
crypto/ecies: harden length check in Decrypt
This commit is contained in:
parent
b80ffe98a5
commit
da5688fe53
1 changed files with 1 additions and 1 deletions
|
|
@ -290,7 +290,7 @@ func (prv *PrivateKey) Decrypt(c, s1, s2 []byte) (m []byte, err error) {
|
|||
switch c[0] {
|
||||
case 2, 3, 4:
|
||||
rLen = (prv.PublicKey.Curve.Params().BitSize + 7) / 4
|
||||
if len(c) < (rLen + hLen + 1) {
|
||||
if len(c) < (rLen + hLen + params.BlockSize) {
|
||||
return nil, ErrInvalidMessage
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in a new issue