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

@ -18,7 +18,6 @@ package tests
import (
"bytes"
"encoding/hex"
"fmt"
"math/big"
"os"
@ -161,8 +160,8 @@ func NewEVMEnvironment(vmTest bool, chainConfig *params.ChainConfig, statedb *st
origin := common.HexToAddress(tx["caller"])
if len(tx["secretKey"]) > 0 {
key, _ := hex.DecodeString(tx["secretKey"])
origin = crypto.PubkeyToAddress(crypto.ToECDSA(key).PublicKey)
key, _ := crypto.HexToECDSA(tx["secretKey"])
origin = crypto.PubkeyToAddress(key.PublicKey)
}
var to *common.Address