mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
Vault/pm-4185/checksum uris (#6485)
* Validate checksum on decrypt of URI * Add uri checksum to domain during encryption * Move hash to stateless encrypt service * Add checksum field to all the other models necessary for syncing with server * Remove old test in favor of `describe` block * PM-4185 Added a boolean to control checksum validation * PM-4185 Fi unit tests * [PM-4810][PM-4825][PM-4880] Fix encrypted import and add null check (#6935) * PM-4810 Bumped up version * PM-4880 Add null check * PM-4825 Fix encrypted export * PM-5462 Fix item saving with blank URI (#7640) * PM-4185 Add back uriChecksum setting --------- Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com> Co-authored-by: Matt Bishop <mbishop@bitwarden.com> Co-authored-by: gbubemismith <gsmithwalter@gmail.com> Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
This commit is contained in:
@@ -125,10 +125,12 @@ export class Cipher extends Domain implements Decryptable<CipherView> {
|
||||
// We will refactor the EncString.decrypt() in https://bitwarden.atlassian.net/browse/PM-3762 to remove the dependency on the organizationId.
|
||||
async decrypt(encKey: SymmetricCryptoKey): Promise<CipherView> {
|
||||
const model = new CipherView(this);
|
||||
let bypassValidation = true;
|
||||
|
||||
if (this.key != null) {
|
||||
const encryptService = Utils.getContainerService().getEncryptService();
|
||||
encKey = new SymmetricCryptoKey(await encryptService.decryptToBytes(this.key, encKey));
|
||||
bypassValidation = false;
|
||||
}
|
||||
|
||||
await this.decryptObj(
|
||||
@@ -143,7 +145,7 @@ export class Cipher extends Domain implements Decryptable<CipherView> {
|
||||
|
||||
switch (this.type) {
|
||||
case CipherType.Login:
|
||||
model.login = await this.login.decrypt(this.organizationId, encKey);
|
||||
model.login = await this.login.decrypt(this.organizationId, bypassValidation, encKey);
|
||||
break;
|
||||
case CipherType.SecureNote:
|
||||
model.secureNote = await this.secureNote.decrypt(this.organizationId, encKey);
|
||||
|
||||
Reference in New Issue
Block a user