1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

Sign binary data not hash on eth_sign

This commit is contained in:
Dan Finlay 2016-06-15 10:48:36 -07:00
parent a4b87b3625
commit 37e552e95d

View File

@ -492,8 +492,8 @@ function IdManagement(opts) {
// sign message
var privKeyHex = this.exportPrivateKey(address)
var privKey = ethUtil.toBuffer(privKeyHex)
var msgHash = ethUtil.sha3(message)
var msgSig = ethUtil.ecsign(msgHash, privKey)
var msgBuffer = new Buffer(message.replace('0x',''), 'hex')
var msgSig = ethUtil.ecsign(msgBuffer, privKey)
var rawMsgSig = ethUtil.bufferToHex(concatSig(msgSig.v, msgSig.r, msgSig.s))
return rawMsgSig
}