From 0db860659bf7405ad05334b4235947c17db40863 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 16 Jul 2018 10:32:55 -0400 Subject: [PATCH] Removing code. Doesn't make sense to specify keys when everyone can read them --- lib/modules/whisper/js/embarkjs.js | 27 +++++-------------- templates/boilerplate/config/communication.js | 7 ----- templates/demo/config/communication.js | 7 ----- 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/lib/modules/whisper/js/embarkjs.js b/lib/modules/whisper/js/embarkjs.js index 28f3f36b..ea72b9d0 100644 --- a/lib/modules/whisper/js/embarkjs.js +++ b/lib/modules/whisper/js/embarkjs.js @@ -17,27 +17,12 @@ __embarkWhisperNewWeb3.setProvider = function (options) { if (err) { console.log("whisper not available"); } else if (version >= 5) { - - if (options.symKey) { - self.web3.shh.addSymKey(options.symKey).then(id => { - self.symKeyID = id; - }); - } else { - self.web3.shh.newSymKey().then((id) => { - self.symKeyID = id; - }); - } - - if (options.privateKey) { - self.web3.shh.addPrivateKey(options.privateKey).then((id) => { - self.sig = id; - }); - } else { - self.web3.shh.newKeyPair().then((id) => { - self.sig = id; - }); - } - + self.web3.shh.newSymKey().then((id) => { + self.symKeyID = id; + }); + self.web3.shh.newKeyPair().then((id) => { + self.sig = id; + }); } else { throw new Error("version of whisper not supported"); } diff --git a/templates/boilerplate/config/communication.js b/templates/boilerplate/config/communication.js index cf68c45a..035d95de 100644 --- a/templates/boilerplate/config/communication.js +++ b/templates/boilerplate/config/communication.js @@ -8,13 +8,6 @@ module.exports = { port: 8546, // Port of the blockchain node type: "ws" // Type of connection (ws or rpc) } - // Use this section when you need a specific symmetric or private keys in whisper - /* - ,keys: { - symmetricKey: "your_symmetric_key",// Symmetric key for message decryption - privateKey: "your_private_key" // Private Key to be used as a signing key and for message decryption - } - */ } }; diff --git a/templates/demo/config/communication.js b/templates/demo/config/communication.js index 61fef697..8c4d1f91 100644 --- a/templates/demo/config/communication.js +++ b/templates/demo/config/communication.js @@ -8,12 +8,5 @@ module.exports = { port: 8546, // Port of the blockchain node type: "ws" // Type of connection (ws or rpc) } - // Use this section when you need a specific symmetric or private keys in whisper - /* - ,keys: { - symmetricKey: "your_symmetric_key",// Symmetric key for message decryption - privateKey: "your_private_key" // Private Key to be used as a signing key and for message decryption - } - */ } };