mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
crypto/ecies: fix panic on short ciphertext in symDecrypt
This commit is contained in:
parent
6530945dcd
commit
b8904599e3
1 changed files with 3 additions and 0 deletions
|
|
@ -221,6 +221,9 @@ func symDecrypt(params *ECIESParams, key, ct []byte) (m []byte, err error) {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
if len(ct) < params.BlockSize {
|
||||
return nil, ErrInvalidMessage
|
||||
}
|
||||
|
||||
ctr := cipher.NewCTR(c, ct[:params.BlockSize])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue