1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Split native messaging into renderer and background service. Encrypt messages and verify timestamp

This commit is contained in:
Hinton
2020-10-12 21:18:28 +02:00
parent 44cd222626
commit 51b749b1dc
7 changed files with 240 additions and 203 deletions

View File

@@ -18,7 +18,7 @@ import { ElectronStorageService } from 'jslib/electron/services/electronStorage.
import { TrayMain } from 'jslib/electron/tray.main';
import { UpdaterMain } from 'jslib/electron/updater.main';
import { WindowMain } from 'jslib/electron/window.main';
import { NativeMessagingService } from './services/nativeMessaging.service';
import { NativeMessagingMain } from './main/nativeMessaging.main';
export class Main {
logService: ElectronLogService;
@@ -34,7 +34,7 @@ export class Main {
powerMonitorMain: PowerMonitorMain;
trayMain: TrayMain;
biometricMain: BiometricMain;
nativeMessagingService: NativeMessagingService;
nativeMessagingMain: NativeMessagingMain;
constructor() {
// Set paths for portable builds
@@ -119,7 +119,7 @@ export class Main {
this.biometricMain = new BiometricDarwinMain(this.storageService, this.i18nService);
}
this.nativeMessagingService = new NativeMessagingService(this.logService, this.biometricMain, app.getPath('userData'), app.getAppPath());
this.nativeMessagingMain = new NativeMessagingMain(this.logService, this.windowMain, app.getPath('userData'), app.getAppPath());
}
bootstrap() {
@@ -145,7 +145,7 @@ export class Main {
}
if (await this.storageService.get<boolean>(ElectronConstants.enableBrowserIntegration)) {
this.nativeMessagingService.listen();
this.nativeMessagingMain.listen();
}
if (!app.isDefaultProtocolClient('bitwarden')) {