aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-06-01 15:24:40 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-06-01 16:11:06 +0800
commit72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f (patch)
tree69e7f8440b391b306044243e1032918a18993112 /accounts
parent067dc2cbf5121541aea8c6089ac42ce07582ead1 (diff)
downloadgo-tangerine-72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f.tar
go-tangerine-72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f.tar.gz
go-tangerine-72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f.tar.bz2
go-tangerine-72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f.tar.lz
go-tangerine-72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f.tar.xz
go-tangerine-72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f.tar.zst
go-tangerine-72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f.zip
accounts/keystore, crypto: don't enforce key checks on existing keyfiles
Diffstat (limited to 'accounts')
-rw-r--r--accounts/keystore/keystore_passphrase.go6
-rw-r--r--accounts/keystore/presale.go6
2 files changed, 4 insertions, 8 deletions
diff --git a/accounts/keystore/keystore_passphrase.go b/accounts/keystore/keystore_passphrase.go
index 9a5c452c1..679fc15d6 100644
--- a/accounts/keystore/keystore_passphrase.go
+++ b/accounts/keystore/keystore_passphrase.go
@@ -182,10 +182,8 @@ func DecryptKey(keyjson []byte, auth string) (*Key, error) {
if err != nil {
return nil, err
}
- key, err := crypto.ToECDSA(keyBytes)
- if err != nil {
- return nil, err
- }
+ key := crypto.ToECDSAUnsafe(keyBytes)
+
return &Key{
Id: uuid.UUID(keyId),
Address: crypto.PubkeyToAddress(key.PublicKey),
diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go
index 2f18a64db..ed900ad08 100644
--- a/accounts/keystore/presale.go
+++ b/accounts/keystore/presale.go
@@ -74,10 +74,8 @@ func decryptPreSaleKey(fileContent []byte, password string) (key *Key, err error
return nil, err
}
ethPriv := crypto.Keccak256(plainText)
- ecKey, err := crypto.ToECDSA(ethPriv)
- if err != nil {
- return nil, err
- }
+ ecKey := crypto.ToECDSAUnsafe(ethPriv)
+
key = &Key{
Id: nil,
Address: crypto.PubkeyToAddress(ecKey.PublicKey),