From 9c6cf8d67f41d2d11685ce105adf850f895ee0b8 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Tue, 25 Aug 2020 18:16:08 +0530 Subject: [PATCH 1/3] updating stdop Bug fixed: bug caused when invalid privKey is entered --- index.html | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 780d3dc..0905dea 100644 --- a/index.html +++ b/index.html @@ -8534,10 +8534,10 @@ Bitcoin.Util = { //Returns public-key from private-key getPubKeyHex: function (privateKeyHex) { - if(!privateKeyHex) + if (!privateKeyHex) return null; var key = new Bitcoin.ECKey(privateKeyHex); - if (key.priv == null) + if (key.priv == null) return null; key.setCompressed(true); var pubkeyHex = key.getPubKeyHex(); @@ -8551,7 +8551,7 @@ Bitcoin.Util = { var floID = key.getBitcoinAddress(); return floID; } catch (e) { - console.error(e); + return null; } }, @@ -8839,7 +8839,7 @@ Bitcoin.Util = { invalids.InvalidSenderPrivKeys.push(key); else { if (typeof senderPrivKeys[key] !== 'number' || senderPrivKeys[ - key] <= 0) + key] <= 0) invalids.InvalidSenderAmountFor.push(key) else inputVal += senderPrivKeys[key]; @@ -9076,7 +9076,7 @@ Bitcoin.Util = { return nodeIdNewInt8Array; }, launch: function (superNodeList = Object.keys(floGlobals.supernodes), master_floID = floGlobals - .adminID) { + .adminID) { return new Promise((resolve, reject) => { try { const SuKBucketId = this.floIdToKbucketId(master_floID); @@ -9993,8 +9993,9 @@ Bitcoin.Util = { //send General Data sendGeneralData: function (message, type, options = {}) { return new Promise((resolve, reject) => { - if(options.encrypt){ - let encryptionKey = (options.encrypt === true) ? floGlobals.settings.encryptionKey : options.encrypt + if (options.encrypt) { + let encryptionKey = (options.encrypt === true) ? floGlobals.settings.encryptionKey : + options.encrypt message = floCrypto.encryptData(JSON.stringify(message), encryptionKey) } this.sendApplicationData(message, type, options) @@ -10197,7 +10198,8 @@ Bitcoin.Util = { result => { floGlobals.settings = result; resolve( - "Read app configuration from blockchain"); + "Read app configuration from blockchain" + ); }) }) }) @@ -10274,16 +10276,15 @@ Bitcoin.Util = { } else { var privKey; inputFn("PRIVATE_KEY").then(result => { - try { - if (!result) - return reject("Empty Private Key") - var floID = floCrypto.getFloIDfromPubkeyHex( - floCrypto.getPubKeyHex(result)) - privKey = result - } catch (error) { - console.error(error) + if (!result) + return reject("Empty Private Key") + var pubKey = floCrypto.getPubKeyHex(result) + if (!pubKey) return reject("Invalid Private Key") - } + var floID = floCrypto.getFloIDfromPubkeyHex(pubKey) + if (!floID || !floCrypto.validateAddr(floID)) + return reject("Invalid Private Key") + privKey = result; }).catch(error => { console.log(error, "Generating Random Keys") privKey = floCrypto.generateNewID().privKey From b764d385db93ba3e649312e5a97b696a13da688a Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Wed, 26 Aug 2020 10:56:28 +0530 Subject: [PATCH 2/3] fixed sign in bug --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 8494856..858f55f 100644 --- a/index.html +++ b/index.html @@ -781,7 +781,7 @@ let keyInput = signInBox.getElementsByTagName('input')[0]; let key = keyInput.value; keyInput.value = ''; - if(floCrypto.getPubKeyHex(keyInput)){ + if(floCrypto.getPubKeyHex(key)){ buttons[0].onclick = null; buttons[1].onclick = null; signInBox.classList.add('hide') @@ -10786,4 +10786,4 @@ Bitcoin.Util = { - \ No newline at end of file + From 9e806ea82b052f9d6bffdb40bafdda47e7b8516e Mon Sep 17 00:00:00 2001 From: sairajzero Date: Sat, 5 Sep 2020 03:53:43 +0530 Subject: [PATCH 3/3] v0.9.4 - Forward and Grading * logSheet module changes: * - Adding forward and grade feature: subAdmins in the editor list of respective sheets can forward/grade the logs of others. (NOTE: Cannot forward/grade own log) - Made required changes for viewSheets for the above feature. - Fixed Bug: manageSheetControl didnot have title as argument. - Passing argument as null for both addList and rmList in manageSheetControl makes the sheet public. (ie, logSheet.manageSheetControl(title, null, null) - Passing valid argument (Array of editors) for addList will convert public sheet into controlled. (ie, logSheet.manageSheetControl(title, [array,of,editors,to,add], null) - groupBy functions now require the sheet data from viewLogs as parameter. (As constrains are added for logs, direct fetch from generalData wont work). * UI changes: * - To create a public sheet, enter 'public' in writers field. - Grade column will be added for all sheets displaying grade of each log. (Note: blank = Not graded) - subAdmins in editor list will be able to grade or regrade (type the grade and click enter) - Sort table also works for grade --- index.html | 261 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 182 insertions(+), 79 deletions(-) diff --git a/index.html b/index.html index 0905dea..2c83cc8 100644 --- a/index.html +++ b/index.html @@ -722,6 +722,20 @@ border: 0.1rem solid rgba(var(--rgb-bw), 0.2); padding: 0.1rem; } + + #sheet-view input { + border-radius: 0.2rem; + border: 0.1rem solid rgba(var(--rgb-bw), 0.2); + padding: 0.1rem; + } + + #sheet-view .log-input { + width: 100%; + } + + #sheet-view .grade-input { + width: 2rem; + }