send nonce to sw

This commit is contained in:
Danny Coates 2018-07-19 13:20:10 -07:00
parent 86f2a531d4
commit f32ebd913a
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
2 changed files with 3 additions and 1 deletions

View File

@ -110,6 +110,7 @@ export default class FileReceiver extends Nanobus {
password: this.fileInfo.password, password: this.fileInfo.password,
url: this.fileInfo.url, url: this.fileInfo.url,
size: this.fileInfo.size, size: this.fileInfo.size,
nonce: this.keychain.nonce,
noSave noSave
}; };
await this.sendMessageToSw(info); await this.sendMessageToSw(info);

View File

@ -18,7 +18,7 @@ async function decryptStream(request) {
const id = request.url.split('/')[5]; const id = request.url.split('/')[5];
try { try {
const file = map.get(id); const file = map.get(id);
const keychain = new Keychain(file.key); const keychain = new Keychain(file.key, file.nonce);
file.download = downloadStream(id, keychain); file.download = downloadStream(id, keychain);
@ -63,6 +63,7 @@ self.onmessage = event => {
noSave = event.data.noSave; noSave = event.data.noSave;
const info = { const info = {
key: event.data.key, key: event.data.key,
nonce: event.data.nonce,
filename: event.data.filename, filename: event.data.filename,
type: event.data.type, type: event.data.type,
size: event.data.size, size: event.data.size,