send nonce to sw
This commit is contained in:
parent
86f2a531d4
commit
f32ebd913a
@ -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);
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user