accounts/keystore, crypto: enforce 256 bit keys on import
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user