1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

Merge branch 'master' into EC-598-beeep-properly-store-passkeys-in-bitwarden

This commit is contained in:
Todd Martin
2023-09-28 12:18:34 -04:00
300 changed files with 2905 additions and 1442 deletions

View File

@@ -37,7 +37,9 @@ export class CollectionsComponent implements OnInit {
async load() {
this.cipherDomain = await this.loadCipher();
this.collectionIds = this.loadCipherCollections();
this.cipher = await this.cipherDomain.decrypt();
this.cipher = await this.cipherDomain.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(this.cipherDomain)
);
this.collections = await this.loadCollections();
this.collections.forEach((c) => ((c as any).checked = false));

View File

@@ -66,7 +66,9 @@ export class ShareComponent implements OnInit, OnDestroy {
});
const cipherDomain = await this.cipherService.get(this.cipherId);
this.cipher = await cipherDomain.decrypt();
this.cipher = await cipherDomain.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(cipherDomain)
);
this.filterCollections();
}
@@ -94,7 +96,9 @@ export class ShareComponent implements OnInit, OnDestroy {
}
const cipherDomain = await this.cipherService.get(this.cipherId);
const cipherView = await cipherDomain.decrypt();
const cipherView = await cipherDomain.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(cipherDomain)
);
const orgs = await firstValueFrom(this.organizations$);
const orgName =
orgs.find((o) => o.id === this.organizationId)?.name ?? this.i18nService.t("organization");

View File

@@ -271,7 +271,8 @@ import { AbstractThemingService } from "./theming/theming.service.abstraction";
searchService: SearchServiceAbstraction,
stateService: StateServiceAbstraction,
encryptService: EncryptService,
fileUploadService: CipherFileUploadServiceAbstraction
fileUploadService: CipherFileUploadServiceAbstraction,
configService: ConfigServiceAbstraction
) =>
new CipherService(
cryptoService,
@@ -281,7 +282,8 @@ import { AbstractThemingService } from "./theming/theming.service.abstraction";
searchService,
stateService,
encryptService,
fileUploadService
fileUploadService,
configService
),
deps: [
CryptoServiceAbstraction,
@@ -292,6 +294,7 @@ import { AbstractThemingService } from "./theming/theming.service.abstraction";
StateServiceAbstraction,
EncryptService,
CipherFileUploadServiceAbstraction,
ConfigServiceAbstraction,
],
},
{

View File

@@ -225,7 +225,9 @@ export class AddEditComponent implements OnInit, OnDestroy {
if (this.cipher == null) {
if (this.editMode) {
const cipher = await this.loadCipher();
this.cipher = await cipher.decrypt();
this.cipher = await cipher.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(cipher)
);
// Adjust Cipher Name if Cloning
if (this.cloneMode) {
@@ -272,6 +274,9 @@ export class AddEditComponent implements OnInit, OnDestroy {
}
this.previousCipherId = this.cipherId;
this.reprompt = this.cipher.reprompt !== CipherRepromptType.None;
if (this.reprompt) {
this.cipher.login.autofillOnPageLoad = this.autofillOnPageLoadOptions[2].value;
}
}
async submit(): Promise<boolean> {
@@ -574,8 +579,10 @@ export class AddEditComponent implements OnInit, OnDestroy {
this.reprompt = !this.reprompt;
if (this.reprompt) {
this.cipher.reprompt = CipherRepromptType.Password;
this.cipher.login.autofillOnPageLoad = this.autofillOnPageLoadOptions[2].value;
} else {
this.cipher.reprompt = CipherRepromptType.None;
this.cipher.login.autofillOnPageLoad = this.autofillOnPageLoadOptions[0].value;
}
}

View File

@@ -73,7 +73,9 @@ export class AttachmentsComponent implements OnInit {
try {
this.formPromise = this.saveCipherAttachment(files[0]);
this.cipherDomain = await this.formPromise;
this.cipher = await this.cipherDomain.decrypt();
this.cipher = await this.cipherDomain.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(this.cipherDomain)
);
this.platformUtilsService.showToast("success", null, this.i18nService.t("attachmentSaved"));
this.onUploadedAttachment.emit();
} catch (e) {
@@ -179,7 +181,9 @@ export class AttachmentsComponent implements OnInit {
protected async init() {
this.cipherDomain = await this.loadCipher();
this.cipher = await this.cipherDomain.decrypt();
this.cipher = await this.cipherDomain.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(this.cipherDomain)
);
const canAccessPremium = await this.stateService.getCanAccessPremium();
this.canAccessAttachments = canAccessPremium || this.cipher.organizationId != null;
@@ -229,7 +233,9 @@ export class AttachmentsComponent implements OnInit {
decBuf,
admin
);
this.cipher = await this.cipherDomain.decrypt();
this.cipher = await this.cipherDomain.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(this.cipherDomain)
);
// 3. Delete old
this.deletePromises[attachment.id] = this.deleteCipherAttachment(attachment.id);

View File

@@ -33,7 +33,9 @@ export class PasswordHistoryComponent implements OnInit {
protected async init() {
const cipher = await this.cipherService.get(this.cipherId);
const decCipher = await cipher.decrypt();
const decCipher = await cipher.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(cipher)
);
this.history = decCipher.passwordHistory == null ? [] : decCipher.passwordHistory;
}
}

View File

@@ -114,7 +114,9 @@ export class ViewComponent implements OnDestroy, OnInit {
this.cleanUp();
const cipher = await this.cipherService.get(this.cipherId);
this.cipher = await cipher.decrypt();
this.cipher = await cipher.decrypt(
await this.cipherService.getKeyForCipherKeyDecryption(cipher)
);
this.canAccessPremium = await this.stateService.getCanAccessPremium();
this.showPremiumRequiredTotp =
this.cipher.login.totp && !this.canAccessPremium && !this.cipher.organizationUseTotp;