diff --git a/api/helpers.ts b/api/helpers.ts index 26ed7e7..6f68d1f 100644 --- a/api/helpers.ts +++ b/api/helpers.ts @@ -201,7 +201,7 @@ function newkeyexchangemsg(type, sender){ return { type: type, sender: { - // pub_key: sender.publicKey, + pub_key: sender.publicKey, contact_key: sender.contactKey, ...sender.alias && {alias: sender.alias}, ...includePhotoUrl && {photo_url: sender.photoUrl} diff --git a/api/network/receive.ts b/api/network/receive.ts index fb8ee9c..4c11b26 100644 --- a/api/network/receive.ts +++ b/api/network/receive.ts @@ -3,7 +3,8 @@ import * as lndService from '../grpc' import {getInfo} from '../utils/lightning' import {ACTIONS} from '../controllers' import * as tribes from '../utils/tribes' -import {SPHINX_CUSTOM_RECORD_KEY, verifyAscii} from '../utils/lightning' +import {SPHINX_CUSTOM_RECORD_KEY} from '../utils/lightning' +import * as signer from '../utils/signer' import { models } from '../models' import {sendMessage} from './send' import {modifyPayloadAndSaveMediaKey,purchaseFromOriginalSender,sendFinalMemeIfFirstPurchaser} from './modify' @@ -176,15 +177,18 @@ async function parseAndVerifyPayload(data){ const sig = data.substring(li+1) try { payload = JSON.parse(msg) - if(payload) { - const v = await verifyAscii(msg, sig) - if(v && v.valid && v.pubkey) { - payload.sender = payload.sender||{} - payload.sender.pub_key=v.pubkey + if(payload && payload.sender && payload.sender.pub_key) { + let v + if(sig.length===96) { // => RM THIS + v = await signer.verifyAscii(msg, sig, payload.sender.pub_key) + } + if(v && v.valid) { return payload } else { return payload // => RM THIS } + } else { + return payload // => RM THIS } } catch(e) { if(payload) return payload // => RM THIS diff --git a/api/network/send.ts b/api/network/send.ts index ced5308..4f9b469 100644 --- a/api/network/send.ts +++ b/api/network/send.ts @@ -1,5 +1,6 @@ import { models } from '../models' import * as LND from '../utils/lightning' +import * as signer from '../utils/signer' import {personalizeMessage, decryptMessage} from '../utils/msg' import * as path from 'path' import * as tribes from '../utils/tribes' @@ -101,7 +102,7 @@ export function signAndSend(opts, mqttTopic?:string){ let data = JSON.stringify(opts.data||{}) opts.amt = opts.amt || 0 - const sig = await LND.signAscii(data) + const sig = await signer.signAscii(data) data = data + sig // console.log("ACTUALLY SEND", mqttTopic) diff --git a/api/utils/signer.ts b/api/utils/signer.ts index 44f420a..d9649c6 100644 --- a/api/utils/signer.ts +++ b/api/utils/signer.ts @@ -38,7 +38,8 @@ export const signMessage = (msg) => { if(err || !sig.signature) { reject(err) } else { - resolve(sig.signature) + const buf = ByteBuffer.wrap(sig.signature); + resolve(buf.toBase64()) } }) } catch(e) { @@ -56,7 +57,8 @@ export const signBuffer = (msg) => { if(err || !sig.signature) { reject(err) } else { - resolve(sig.signature) + const buf = ByteBuffer.wrap(sig.signature); + resolve(buf.toBase64()) } }) } catch(e) { @@ -68,10 +70,16 @@ export const signBuffer = (msg) => { function verifyMessage(msg,sig,pubkey): Promise<{[k:string]:any}> { return new Promise(async(resolve, reject)=> { let signer = await loadSigner() + if(sig.length!==96) { + return reject('invalid sig') + } + if(pubkey.length!==66) { + return reject('invalid pubkey') + } try { const options = { msg:ByteBuffer.fromHex(msg), - signature:sig, + signature:ByteBuffer.fromBase64(sig), pubkey:ByteBuffer.fromHex(pubkey), } signer.verifyMessage(options, function(err,res){ diff --git a/dist/api/helpers.js b/dist/api/helpers.js index 698c1f6..6d8a2d9 100644 --- a/dist/api/helpers.js +++ b/dist/api/helpers.js @@ -206,9 +206,7 @@ function newkeyexchangemsg(type, sender) { const includePhotoUrl = sender && sender.photoUrl && !sender.privatePhoto; return { type: type, - sender: Object.assign(Object.assign({ - // pub_key: sender.publicKey, - contact_key: sender.contactKey }, sender.alias && { alias: sender.alias }), includePhotoUrl && { photo_url: sender.photoUrl }) + sender: Object.assign(Object.assign({ pub_key: sender.publicKey, contact_key: sender.contactKey }, sender.alias && { alias: sender.alias }), includePhotoUrl && { photo_url: sender.photoUrl }) }; } //# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/dist/api/helpers.js.map b/dist/api/helpers.js.map index 1e962ec..7b6a236 100644 --- a/dist/api/helpers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,CAAC;SAC7C;IACF,CAAC;CAAA;AAED,SAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM;IACtC,MAAM,eAAe,GAAG,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,YAAY,CAAA;IACzE,OAAO;QACN,IAAI,EAAE,IAAI;QACV,MAAM,gCACL,OAAO,EAAE,MAAM,CAAC,SAAS,EACzB,WAAW,EAAE,MAAM,CAAC,UAAU,IAC3B,MAAM,CAAC,KAAK,IAAI,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAC,GACrC,eAAe,IAAI,EAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAC,CAClD;KACD,CAAA;AACF,CAAC"} \ No newline at end of file diff --git a/dist/api/network/receive.js b/dist/api/network/receive.js index 36687ed..52dc80e 100644 --- a/dist/api/network/receive.js +++ b/dist/api/network/receive.js @@ -15,6 +15,7 @@ const lightning_1 = require("../utils/lightning"); const controllers_1 = require("../controllers"); const tribes = require("../utils/tribes"); const lightning_2 = require("../utils/lightning"); +const signer = require("../utils/signer"); const models_1 = require("../models"); const send_1 = require("./send"); const modify_1 = require("./modify"); @@ -200,17 +201,21 @@ function parseAndVerifyPayload(data) { const sig = data.substring(li + 1); try { payload = JSON.parse(msg); - if (payload) { - const v = yield lightning_2.verifyAscii(msg, sig); - if (v && v.valid && v.pubkey) { - payload.sender = payload.sender || {}; - payload.sender.pub_key = v.pubkey; + if (payload && payload.sender && payload.sender.pub_key) { + let v; + if (sig.length === 96) { // => RM THIS + v = yield signer.verifyAscii(msg, sig, payload.sender.pub_key); + } + if (v && v.valid) { return payload; } else { return payload; // => RM THIS } } + else { + return payload; // => RM THIS + } } catch (e) { if (payload) diff --git a/dist/api/network/receive.js.map b/dist/api/network/receive.js.map index 01190fd..d03d997 100644 --- a/dist/api/network/receive.js.map +++ b/dist/api/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../api/network/receive.ts"],"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,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/dist/api/network/send.js b/dist/api/network/send.js index 1d39d06..2327a98 100644 --- a/dist/api/network/send.js +++ b/dist/api/network/send.js @@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); const models_1 = require("../models"); const LND = require("../utils/lightning"); +const signer = require("../utils/signer"); const msg_1 = require("../utils/msg"); const path = require("path"); const tribes = require("../utils/tribes"); @@ -110,7 +111,7 @@ function signAndSend(opts, mqttTopic) { } let data = JSON.stringify(opts.data || {}); opts.amt = opts.amt || 0; - const sig = yield LND.signAscii(data); + const sig = yield signer.signAscii(data); data = data + sig; // console.log("ACTUALLY SEND", mqttTopic) try { diff --git a/dist/api/network/send.js.map b/dist/api/network/send.js.map index 0434eae..21b08cb 100644 --- a/dist/api/network/send.js.map +++ b/dist/api/network/send.js.map @@ -1 +1 @@ -{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../api/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,sCAA+D;AAC/D,6BAA4B;AAC5B,0CAAyC;AACzC,gEAAuE;AACvE,uCAAwC;AAExC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,C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,KAAK,CAAC,EAAE;;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file diff --git a/dist/api/utils/signer.js b/dist/api/utils/signer.js index 1913229..c76d6a3 100644 --- a/dist/api/utils/signer.js +++ b/dist/api/utils/signer.js @@ -47,7 +47,8 @@ exports.signMessage = (msg) => { reject(err); } else { - resolve(sig.signature); + const buf = ByteBuffer.wrap(sig.signature); + resolve(buf.toBase64()); } }); } @@ -66,7 +67,8 @@ exports.signBuffer = (msg) => { reject(err); } else { - resolve(sig.signature); + const buf = ByteBuffer.wrap(sig.signature); + resolve(buf.toBase64()); } }); } @@ -78,10 +80,16 @@ exports.signBuffer = (msg) => { function verifyMessage(msg, sig, pubkey) { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let signer = yield exports.loadSigner(); + if (sig.length !== 96) { + return reject('invalid sig'); + } + if (pubkey.length !== 66) { + return reject('invalid pubkey'); + } try { const options = { msg: ByteBuffer.fromHex(msg), - signature: sig, + signature: ByteBuffer.fromBase64(sig), pubkey: ByteBuffer.fromHex(pubkey), }; signer.verifyMessage(options, function (err, res) { diff --git a/dist/api/utils/signer.js.map b/dist/api/utils/signer.js.map index 1072220..55d7923 100644 --- a/dist/api/utils/signer.js.map +++ b/dist/api/utils/signer.js.map @@ -1 +1 @@ -{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../api/utils/signer.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,6BAA4B;AAC5B,2CAA2C;AAC3C,6BAA4B;AAC5B,yCAAwC;AAExC,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,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AAC,CAAC,CAAA;SACH;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAC,CAAC,CAAA;SACV;IACH,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC;AAED,SAAsB,SAAS,CAAC,KAAK;;QACnC,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,mBAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;YACnD,OAAO,GAAG,CAAA;SACX;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAPD,8BAOC;AAED,SAAsB,WAAW,CAAC,KAAY,EAAC,GAAU,EAAC,MAAa;;QACrE,IAAI;YACF,MAAM,CAAC,GAAG,MAAM,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,EAAC,GAAG,EAAC,MAAM,CAAC,CAAA;YAC9D,OAAO,CAAC,CAAA;SACT;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAPD,kCAOC;AAED,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file +{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../api/utils/signer.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,6BAA4B;AAC5B,2CAA2C;AAC3C,6BAA4B;AAC5B,yCAAwC;AAExC,kDAAkD;AAClD,MA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