From f32ebd913ac591eb2b51c5fdc777db0eba14dd00 Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Thu, 19 Jul 2018 13:20:10 -0700 Subject: [PATCH] send nonce to sw --- app/fileReceiver.js | 1 + app/serviceWorker.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/fileReceiver.js b/app/fileReceiver.js index 5ee9eb4b..e694245b 100644 --- a/app/fileReceiver.js +++ b/app/fileReceiver.js @@ -110,6 +110,7 @@ export default class FileReceiver extends Nanobus { password: this.fileInfo.password, url: this.fileInfo.url, size: this.fileInfo.size, + nonce: this.keychain.nonce, noSave }; await this.sendMessageToSw(info); diff --git a/app/serviceWorker.js b/app/serviceWorker.js index 06cddce1..a539b1d8 100644 --- a/app/serviceWorker.js +++ b/app/serviceWorker.js @@ -18,7 +18,7 @@ async function decryptStream(request) { const id = request.url.split('/')[5]; try { const file = map.get(id); - const keychain = new Keychain(file.key); + const keychain = new Keychain(file.key, file.nonce); file.download = downloadStream(id, keychain); @@ -63,6 +63,7 @@ self.onmessage = event => { noSave = event.data.noSave; const info = { key: event.data.key, + nonce: event.data.nonce, filename: event.data.filename, type: event.data.type, size: event.data.size,