From 37e552e95d67c8cf0273d0bb00eccd6ba0424f64 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 15 Jun 2016 10:48:36 -0700 Subject: [PATCH] Sign binary data not hash on eth_sign --- app/scripts/lib/idStore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index e9b9e0e06..e77ba87f8 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -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 }