remove decrypt-lns unused

pull/1783/head
Audric Ackermann 4 years ago
parent 85e0c9cf36
commit 02bc52f5ec
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -973,32 +973,6 @@ ipc.on('get-auto-update-setting', event => {
event.returnValue = typeof configValue !== 'boolean' ? true : configValue;
});
async function decryptLns(event, lnsName, ciphertext) {
const sodium = await getSodium();
const salt = new Uint8Array(sodium.crypto_pwhash_SALTBYTES);
try {
const key = sodium.crypto_pwhash(
sodium.crypto_secretbox_KEYBYTES,
lnsName,
salt,
sodium.crypto_pwhash_OPSLIMIT_MODERATE,
sodium.crypto_pwhash_MEMLIMIT_MODERATE,
sodium.crypto_pwhash_ALG_ARGON2ID13
);
const nonce = new Uint8Array(sodium.crypto_secretbox_NONCEBYTES);
const res = sodium.crypto_secretbox_open_easy(ciphertext, nonce, key);
// null as first parameter to indivate no error
event.reply('decrypt-lns-response', null, res);
} catch (err) {
event.reply('decrypt-lns-response', err);
}
}
async function blake2bDigest(event, input) {
const sodium = await getSodium();
@ -1015,10 +989,6 @@ ipc.on('blake2b-digest', (event, input) => {
blake2bDigest(event, input);
});
ipc.on('decrypt-lns-entry', (event, lnsName, ciphertext) => {
decryptLns(event, lnsName, ciphertext);
});
ipc.on('set-auto-update-setting', (event, enabled) => {
userConfig.set('autoUpdate', !!enabled);

@ -112,16 +112,6 @@ window.blake2b = input =>
ipc.send('blake2b-digest', input);
});
window.decryptLnsEntry = (key, value) =>
new Promise((resolve, reject) => {
ipc.once('decrypt-lns-response', (_, error, res) => {
// eslint-disable-next-line no-unused-expressions
error ? reject(error) : resolve(res);
});
ipc.send('decrypt-lns-entry', key, value);
});
window.updateZoomFactor = () => {
const zoomFactor = window.getSettingValue('zoom-factor-setting') || 100;
window.setZoomFactor(zoomFactor / 100);

Loading…
Cancel
Save