mirror of https://github.com/keeweb/keeweb.git
moved ipc handlers setup to corresponding files
This commit is contained in:
parent
7bea4ad282
commit
e06e9ac1f8
|
@ -0,0 +1,4 @@
|
|||
const { ipcMain } = require('electron');
|
||||
|
||||
ipcMain.handle('browserExtensionConnectorStart', () => {});
|
||||
ipcMain.handle('browserExtensionConnectorStop', () => {});
|
|
@ -1,17 +1,16 @@
|
|||
const { ipcMain } = require('electron');
|
||||
const { readXoredValue, makeXoredValue } = require('../util/byte-utils');
|
||||
const { reqNative } = require('../util/req-native');
|
||||
|
||||
ipcMain.handle('hardwareCryptoDeleteKey', hardwareCryptoDeleteKey);
|
||||
ipcMain.handle('hardwareEncrypt', hardwareEncrypt);
|
||||
ipcMain.handle('hardwareDecrypt', hardwareDecrypt);
|
||||
|
||||
const keyTag = 'net.antelle.keeweb.encryption-key';
|
||||
|
||||
let testCipherParams;
|
||||
let keyChecked = false;
|
||||
|
||||
module.exports = {
|
||||
hardwareCryptoDeleteKey,
|
||||
hardwareEncrypt,
|
||||
hardwareDecrypt
|
||||
};
|
||||
|
||||
async function hardwareCryptoDeleteKey() {
|
||||
const secureEnclave = reqNative('secure-enclave');
|
||||
await secureEnclave.deleteKeyPair({ keyTag });
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
const { ipcMain } = require('electron');
|
||||
const path = require('path');
|
||||
const { spawn } = require('child_process');
|
||||
const { EventEmitter } = require('events');
|
||||
|
||||
ipcMain.on('nativeModuleCall', nativeModuleCall);
|
||||
|
||||
let callbackWebContents;
|
||||
let nativeModuleHost;
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
const { ipcMain } = require('electron');
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
module.exports = {
|
||||
spawnProcess
|
||||
};
|
||||
ipcMain.handle('spawnProcess', spawnProcess);
|
||||
|
||||
function spawnProcess(e, config) {
|
||||
return new Promise((resolve) => {
|
||||
|
|
|
@ -1,16 +1,6 @@
|
|||
const { ipcMain } = require('electron');
|
||||
const {
|
||||
hardwareCryptoDeleteKey,
|
||||
hardwareEncrypt,
|
||||
hardwareDecrypt
|
||||
} = require('./ipc-handlers/hardware-crypto');
|
||||
const { spawnProcess } = require('./ipc-handlers/spawn-process');
|
||||
const { nativeModuleCall } = require('./ipc-handlers/native-module-host-proxy');
|
||||
|
||||
module.exports.setupIpcHandlers = () => {
|
||||
ipcMain.handle('hardwareCryptoDeleteKey', hardwareCryptoDeleteKey);
|
||||
ipcMain.handle('hardwareEncrypt', hardwareEncrypt);
|
||||
ipcMain.handle('hardwareDecrypt', hardwareDecrypt);
|
||||
ipcMain.handle('spawnProcess', spawnProcess);
|
||||
ipcMain.on('nativeModuleCall', nativeModuleCall);
|
||||
require('./ipc-handlers/browser-extension-connector');
|
||||
require('./ipc-handlers/hardware-crypto');
|
||||
require('./ipc-handlers/native-module-host-proxy');
|
||||
require('./ipc-handlers/spawn-process');
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue