1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

support for new attachment keys

This commit is contained in:
Kyle Spearrin
2018-11-13 20:43:45 -05:00
parent c297728967
commit 17e7ee4838
10 changed files with 73 additions and 10 deletions

View File

@@ -143,7 +143,8 @@ export class AttachmentsComponent implements OnInit {
try {
const buf = await response.arrayBuffer();
const key = await this.cryptoService.getOrgKey(this.cipher.organizationId);
const key = attachment.key != null ? attachment.key :
await this.cryptoService.getOrgKey(this.cipher.organizationId);
const decBuf = await this.cryptoService.decryptFromBytes(buf, key);
this.platformUtilsService.saveFile(this.win, decBuf, null, attachment.fileName);
} catch (e) {

View File

@@ -171,7 +171,8 @@ export class ViewComponent implements OnDestroy, OnInit {
try {
const buf = await response.arrayBuffer();
const key = await this.cryptoService.getOrgKey(this.cipher.organizationId);
const key = attachment.key != null ? attachment.key :
await this.cryptoService.getOrgKey(this.cipher.organizationId);
const decBuf = await this.cryptoService.decryptFromBytes(buf, key);
this.platformUtilsService.saveFile(this.win, decBuf, null, attachment.fileName);
} catch (e) {