diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-12-18 19:43:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 19:43:10 +0800 |
commit | 3b79bac05b6a7b9c3845919f274d6014c821ea4c (patch) | |
tree | dbf1bed025be10a8efbfaa18a0344fd423d71b1a | |
parent | 13db4af3450b952c78a09248aa7a6852b69bc0d6 (diff) | |
parent | afc2039f220821155796b64de5f08ccd09fd8412 (diff) | |
download | dexon-3b79bac05b6a7b9c3845919f274d6014c821ea4c.tar dexon-3b79bac05b6a7b9c3845919f274d6014c821ea4c.tar.gz dexon-3b79bac05b6a7b9c3845919f274d6014c821ea4c.tar.bz2 dexon-3b79bac05b6a7b9c3845919f274d6014c821ea4c.tar.lz dexon-3b79bac05b6a7b9c3845919f274d6014c821ea4c.tar.xz dexon-3b79bac05b6a7b9c3845919f274d6014c821ea4c.tar.zst dexon-3b79bac05b6a7b9c3845919f274d6014c821ea4c.zip |
Merge pull request #15698 from original-brownbear/15668
accounts/keystore: Improved error message
-rw-r--r-- | accounts/keystore/presale.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index ed900ad08..1554294e1 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -58,6 +58,9 @@ func decryptPreSaleKey(fileContent []byte, password string) (key *Key, err error if err != nil { return nil, errors.New("invalid hex in encSeed") } + if len(encSeedBytes) < 16 { + return nil, errors.New("invalid encSeed, too short") + } iv := encSeedBytes[:16] cipherText := encSeedBytes[16:] /* |