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 { readXoredValue, makeXoredValue } = require('../util/byte-utils');
|
||||||
const { reqNative } = require('../util/req-native');
|
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';
|
const keyTag = 'net.antelle.keeweb.encryption-key';
|
||||||
|
|
||||||
let testCipherParams;
|
let testCipherParams;
|
||||||
let keyChecked = false;
|
let keyChecked = false;
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
hardwareCryptoDeleteKey,
|
|
||||||
hardwareEncrypt,
|
|
||||||
hardwareDecrypt
|
|
||||||
};
|
|
||||||
|
|
||||||
async function hardwareCryptoDeleteKey() {
|
async function hardwareCryptoDeleteKey() {
|
||||||
const secureEnclave = reqNative('secure-enclave');
|
const secureEnclave = reqNative('secure-enclave');
|
||||||
await secureEnclave.deleteKeyPair({ keyTag });
|
await secureEnclave.deleteKeyPair({ keyTag });
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
const { ipcMain } = require('electron');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { spawn } = require('child_process');
|
const { spawn } = require('child_process');
|
||||||
const { EventEmitter } = require('events');
|
const { EventEmitter } = require('events');
|
||||||
|
|
||||||
|
ipcMain.on('nativeModuleCall', nativeModuleCall);
|
||||||
|
|
||||||
let callbackWebContents;
|
let callbackWebContents;
|
||||||
let nativeModuleHost;
|
let nativeModuleHost;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
|
const { ipcMain } = require('electron');
|
||||||
const { spawn } = require('child_process');
|
const { spawn } = require('child_process');
|
||||||
|
|
||||||
module.exports = {
|
ipcMain.handle('spawnProcess', spawnProcess);
|
||||||
spawnProcess
|
|
||||||
};
|
|
||||||
|
|
||||||
function spawnProcess(e, config) {
|
function spawnProcess(e, config) {
|
||||||
return new Promise((resolve) => {
|
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 = () => {
|
module.exports.setupIpcHandlers = () => {
|
||||||
ipcMain.handle('hardwareCryptoDeleteKey', hardwareCryptoDeleteKey);
|
require('./ipc-handlers/browser-extension-connector');
|
||||||
ipcMain.handle('hardwareEncrypt', hardwareEncrypt);
|
require('./ipc-handlers/hardware-crypto');
|
||||||
ipcMain.handle('hardwareDecrypt', hardwareDecrypt);
|
require('./ipc-handlers/native-module-host-proxy');
|
||||||
ipcMain.handle('spawnProcess', spawnProcess);
|
require('./ipc-handlers/spawn-process');
|
||||||
ipcMain.on('nativeModuleCall', nativeModuleCall);
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue