Show fingerprint message
This commit is contained in:
parent
378f603709
commit
a659c86373
|
@ -1362,5 +1362,14 @@
|
||||||
},
|
},
|
||||||
"masterPasswordPolicyRequirementsNotMet": {
|
"masterPasswordPolicyRequirementsNotMet": {
|
||||||
"message": "Your new master password does not meet the policy requirements."
|
"message": "Your new master password does not meet the policy requirements."
|
||||||
|
},
|
||||||
|
"ok": {
|
||||||
|
"message": "Ok"
|
||||||
|
},
|
||||||
|
"desktopSyncVerificationTitle": {
|
||||||
|
"message": "Desktop sync verification"
|
||||||
|
},
|
||||||
|
"desktopIntegrationVerificationText": {
|
||||||
|
"message": "Please verify that the desktop application shows this fingerprint: "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,8 @@ export default class MainBackground {
|
||||||
this.platformUtilsService as BrowserPlatformUtilsService, this.storageService, this.i18nService,
|
this.platformUtilsService as BrowserPlatformUtilsService, this.storageService, this.i18nService,
|
||||||
this.analytics, this.notificationsService, this.systemService, this.vaultTimeoutService,
|
this.analytics, this.notificationsService, this.systemService, this.vaultTimeoutService,
|
||||||
this.environmentService);
|
this.environmentService);
|
||||||
this.nativeMessagingBackground = new NativeMessagingBackground(this.storageService, this.cryptoService, this.cryptoFunctionService, this.vaultTimeoutService, this.runtimeBackground);
|
this.nativeMessagingBackground = new NativeMessagingBackground(this.storageService, this.cryptoService, this.cryptoFunctionService,
|
||||||
|
this.vaultTimeoutService, this.runtimeBackground, this.i18nService, this.userService, this.messagingService);
|
||||||
this.commandsBackground = new CommandsBackground(this, this.passwordGenerationService,
|
this.commandsBackground = new CommandsBackground(this, this.passwordGenerationService,
|
||||||
this.platformUtilsService, this.analytics, this.vaultTimeoutService);
|
this.platformUtilsService, this.analytics, this.vaultTimeoutService);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { CryptoService, LogService, VaultTimeoutService } from 'jslib/abstractions';
|
import { CryptoService } from 'jslib/abstractions/crypto.service';
|
||||||
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||||
|
import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service';
|
||||||
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
||||||
import { StorageService } from 'jslib/abstractions/storage.service';
|
import { StorageService } from 'jslib/abstractions/storage.service';
|
||||||
import { Utils } from 'jslib/misc/utils';
|
import { Utils } from 'jslib/misc/utils';
|
||||||
|
@ -6,6 +8,8 @@ import { SymmetricCryptoKey } from 'jslib/models/domain';
|
||||||
import { ConstantsService } from 'jslib/services';
|
import { ConstantsService } from 'jslib/services';
|
||||||
import { BrowserApi } from '../browser/browserApi';
|
import { BrowserApi } from '../browser/browserApi';
|
||||||
import RuntimeBackground from './runtime.background';
|
import RuntimeBackground from './runtime.background';
|
||||||
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
|
|
||||||
const MessageValidTimeout = 10 * 1000;
|
const MessageValidTimeout = 10 * 1000;
|
||||||
const EncryptionAlgorithm = 'sha1';
|
const EncryptionAlgorithm = 'sha1';
|
||||||
|
@ -22,7 +26,8 @@ export class NativeMessagingBackground {
|
||||||
|
|
||||||
constructor(private storageService: StorageService, private cryptoService: CryptoService,
|
constructor(private storageService: StorageService, private cryptoService: CryptoService,
|
||||||
private cryptoFunctionService: CryptoFunctionService, private vaultTimeoutService: VaultTimeoutService,
|
private cryptoFunctionService: CryptoFunctionService, private vaultTimeoutService: VaultTimeoutService,
|
||||||
private runtimeBackground: RuntimeBackground) {}
|
private runtimeBackground: RuntimeBackground, private i18nService: I18nService, private userService: UserService,
|
||||||
|
private messagingService: MessagingService) {}
|
||||||
|
|
||||||
connect() {
|
connect() {
|
||||||
this.port = BrowserApi.connectNative('com.8bit.bitwarden');
|
this.port = BrowserApi.connectNative('com.8bit.bitwarden');
|
||||||
|
@ -109,6 +114,14 @@ export class NativeMessagingBackground {
|
||||||
[this.publicKey, this.privateKey] = await this.cryptoFunctionService.rsaGenerateKeyPair(2048);
|
[this.publicKey, this.privateKey] = await this.cryptoFunctionService.rsaGenerateKeyPair(2048);
|
||||||
|
|
||||||
this.sendUnencrypted({command: 'setupEncryption', publicKey: Utils.fromBufferToB64(this.publicKey)});
|
this.sendUnencrypted({command: 'setupEncryption', publicKey: Utils.fromBufferToB64(this.publicKey)});
|
||||||
|
const fingerprint = (await this.cryptoService.getFingerprint(await this.userService.getUserId(), this.publicKey)).join(' ');
|
||||||
|
|
||||||
|
this.messagingService.send('showDialog', {
|
||||||
|
html: `${this.i18nService.t('desktopIntegrationVerificationText')}<br><br><strong>${fingerprint}</strong>.`,
|
||||||
|
title: this.i18nService.t('desktopSyncVerificationTitle'),
|
||||||
|
confirmText: this.i18nService.t('ok'),
|
||||||
|
type: 'warning',
|
||||||
|
});
|
||||||
|
|
||||||
return new Promise((resolve, reject) => this.secureSetupResolve = resolve);
|
return new Promise((resolve, reject) => this.secureSetupResolve = resolve);
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,6 +241,7 @@ export class AppComponent implements OnInit {
|
||||||
icon: type as SweetAlertIcon, // required to be any of the SweetAlertIcons to output the iconHtml.
|
icon: type as SweetAlertIcon, // required to be any of the SweetAlertIcons to output the iconHtml.
|
||||||
iconHtml: iconClasses != null ? `<i class="swal-custom-icon fa ${iconClasses}"></i>` : undefined,
|
iconHtml: iconClasses != null ? `<i class="swal-custom-icon fa ${iconClasses}"></i>` : undefined,
|
||||||
text: msg.text,
|
text: msg.text,
|
||||||
|
html: msg.html,
|
||||||
title: msg.title,
|
title: msg.title,
|
||||||
showCancelButton: (cancelText != null),
|
showCancelButton: (cancelText != null),
|
||||||
cancelButtonText: cancelText,
|
cancelButtonText: cancelText,
|
||||||
|
|
Loading…
Reference in New Issue