diff --git a/main.js b/main.js index bfdd50588..d8525d696 100644 --- a/main.js +++ b/main.js @@ -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); diff --git a/preload.js b/preload.js index c8fd8d407..468d17cc6 100644 --- a/preload.js +++ b/preload.js @@ -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);