aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/presale.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-04-02 04:41:47 +0800
committerFelix Lange <fjl@twurst.com>2016-04-12 21:58:07 +0800
commit6f1ca0bc910b65b517277f72ca52dadcdc713570 (patch)
tree11cd425e341f6952a0142fa0abbb9445ea917b7d /accounts/presale.go
parenta9f26dcd0d14c0cb9f309ebccf81e8f741fc4636 (diff)
downloaddexon-6f1ca0bc910b65b517277f72ca52dadcdc713570.tar.gz
dexon-6f1ca0bc910b65b517277f72ca52dadcdc713570.tar.zst
dexon-6f1ca0bc910b65b517277f72ca52dadcdc713570.zip
accounts: add ErrDecrypt
Diffstat (limited to 'accounts/presale.go')
-rw-r--r--accounts/presale.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/accounts/presale.go b/accounts/presale.go
index 86bfc519c..bb82821b9 100644
--- a/accounts/presale.go
+++ b/accounts/presale.go
@@ -22,7 +22,6 @@ import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
- "errors"
"fmt"
"github.com/ethereum/go-ethereum/crypto"
@@ -106,7 +105,7 @@ func aesCBCDecrypt(key, cipherText, iv []byte) ([]byte, error) {
decrypter.CryptBlocks(paddedPlaintext, cipherText)
plaintext := pkcs7Unpad(paddedPlaintext)
if plaintext == nil {
- err = errors.New("Decryption failed: PKCS7Unpad failed after AES decryption")
+ return nil, ErrDecrypt
}
return plaintext, err
}