fixing small issues
This commit is contained in:
parent
c4b7a2bd97
commit
6aa79472bf
6 changed files with 10 additions and 14 deletions
|
@ -4,7 +4,6 @@ const { hexToArray } = require('./utils');
|
|||
class FileReceiver extends EventEmitter {
|
||||
constructor() {
|
||||
super();
|
||||
this.salt = hexToArray(location.pathname.slice(10, -1));
|
||||
}
|
||||
|
||||
download() {
|
||||
|
@ -37,7 +36,7 @@ class FileReceiver extends EventEmitter {
|
|||
data: this.result,
|
||||
aad: meta.aad,
|
||||
filename: meta.filename,
|
||||
iv: meta.iv
|
||||
iv: meta.id
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -72,8 +72,7 @@ class FileSender extends EventEmitter {
|
|||
},
|
||||
secretKey,
|
||||
file.plaintext
|
||||
)
|
||||
.catch(err => console.log('Error with encrypting.')),
|
||||
),
|
||||
window.crypto.subtle.exportKey('jwk', secretKey),
|
||||
new Promise((resolve, reject) => { resolve(file.hash) })
|
||||
]);
|
||||
|
@ -114,7 +113,7 @@ class FileSender extends EventEmitter {
|
|||
'X-File-Metadata',
|
||||
JSON.stringify({
|
||||
aad: arrayToHex(hash),
|
||||
iv: fileId,
|
||||
id: fileId,
|
||||
filename: file.name
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue