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:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user