accounts/keystore, crypto: enforce 256 bit keys on import

This commit is contained in:
Péter Szilágyi
2017-05-23 14:58:03 +03:00
parent 3556962053
commit aa73420207
10 changed files with 32 additions and 31 deletions

View File

@ -182,7 +182,10 @@ func DecryptKey(keyjson []byte, auth string) (*Key, error) {
if err != nil {
return nil, err
}
key := crypto.ToECDSA(keyBytes)
key, err := crypto.ToECDSA(keyBytes)
if err != nil {
return nil, err
}
return &Key{
Id: uuid.UUID(keyId),
Address: crypto.PubkeyToAddress(key.PublicKey),