Skip to content

Commit b890459

Browse files
committed
crypto/ecies: fix panic on short ciphertext in symDecrypt
1 parent 6530945 commit b890459

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crypto/ecies/ecies.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ func symDecrypt(params *ECIESParams, key, ct []byte) (m []byte, err error) {
221221
if err != nil {
222222
return
223223
}
224+
if len(ct) < params.BlockSize {
225+
return nil, ErrInvalidMessage
226+
}
224227

225228
ctr := cipher.NewCTR(c, ct[:params.BlockSize])
226229

0 commit comments

Comments
 (0)