From d03bd796d63b0c17aea457acd61353e62da21632 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 12 Feb 2019 22:24:18 +0100 Subject: Added unique fingerprint function (although it's not working) --- public/scripts/chat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'public/scripts/chat.js') diff --git a/public/scripts/chat.js b/public/scripts/chat.js index eac7246..b85a352 100644 --- a/public/scripts/chat.js +++ b/public/scripts/chat.js @@ -47,6 +47,8 @@ async function evaluateKeyGeneration() { pinInput.init(async (pin, tryCount) => { try { if (await encryption.getId(await encryption.getPublic()) !== peerId) throw "Not verified!"; + const fingerPrint = encryption.getFingerprint(pin); + console.log(fingerPrint); passphrase = new Buffer(crypto.createHmac('SHA256', pin).update(pin).digest('hex')).toString('base64'); await encryption.decryptPrivate(await encryption.getPrivate(), passphrase); chat() @@ -84,7 +86,7 @@ function chat() { $('#chat').fadeIn(); // start the peer - const peer = new Peer(peerId, {host: host, port: 4242, path: '/api', debug: 0}); + const peer = new Peer(peerId, {host: host, port: 4242, path: '/api', secure: true, debug: 0}); // Peer events peer.on('call', call => getMediaStream(stream => call.answer(stream))); // TODO: Ask for call accept -- cgit v1.2.3