From 7f04d8e952d53f00d94d827ac6a78697e6e72a4f Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Fri, 5 Mar 2021 07:53:35 +1000 Subject: [PATCH 1/2] Add extra encrypted export warnings --- src/app/vault/export.component.ts | 19 +++++++++++++++++++ src/locales/en/messages.json | 5 ++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/app/vault/export.component.ts b/src/app/vault/export.component.ts index 0427d478ee..e58cd5e6c0 100644 --- a/src/app/vault/export.component.ts +++ b/src/app/vault/export.component.ts @@ -5,6 +5,8 @@ import { OnInit, } from '@angular/core'; +import * as os from 'os'; + import { CryptoService } from 'jslib/abstractions/crypto.service'; import { EventService } from 'jslib/abstractions/event.service'; import { ExportService } from 'jslib/abstractions/export.service'; @@ -49,4 +51,21 @@ export class ExportComponent extends BaseExportComponent implements OnInit { onWindowHidden() { this.showPassword = false; } + + async warningDialog() { + if (this.encryptedFormat) { + return await this.platformUtilsService.showDialog( + this.i18nService.t('encExportKeyWarningDesc') + + os.EOL + os.EOL + + this.i18nService.t('encExportAccountWarningDesc'), + this.i18nService.t('confirmVaultExport'), this.i18nService.t('exportVault'), + this.i18nService.t('cancel'), 'warning', + true); + } else { + return await this.platformUtilsService.showDialog( + this.i18nService.t('exportWarningDesc'), + this.i18nService.t('confirmVaultExport'), this.i18nService.t('exportVault'), + this.i18nService.t('cancel'), 'warning'); + } + } } diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 768a562ffb..6f8ab9c010 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -1227,9 +1227,12 @@ "exportWarningDesc": { "message": "This export contains your vault data in an unencrypted format. You should not store or send the exported file over unsecure channels (such as email). Delete it immediately after you are done using it." }, - "encExportWarningDesc": { + "encExportKeyWarningDesc": { "message": "This export encrypts your data using your account's encryption key. If you ever rotate your account's encryption key you should export again since you will not be able to decrypt this export file." }, + "encExportAccountWarningDesc": { + "message": "Account encryption keys are unique to each Bitwarden user account, so you can't import an encrypted export into a different account." + }, "exportMasterPassword": { "message": "Enter your master password to export your vault data." }, From 8d05013f75f11124b11b3d42b0bf5bff9ad22aaf Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Fri, 5 Mar 2021 08:59:41 +1000 Subject: [PATCH 2/2] update jslib --- jslib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jslib b/jslib index 3942868cf4..b7acbcf3a7 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 3942868cf488ed8c1983ffadab2c8900b8c78410 +Subproject commit b7acbcf3a7766eb0a52f21fe90505a69b4c19444