1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Fix cipher upload (#346)

* Upload correct data array

* Require BufferArray Encryption for upload to server

The CipherArrayBuffer tiny type is only created by CryptoService
and required by all upload methods

* Add test for attachment upload encryption
This commit is contained in:
Matt Gibson
2021-04-14 10:47:10 -05:00
committed by GitHub
parent c832728b6d
commit 0a0cdaa7fd
12 changed files with 118 additions and 41 deletions

View File

@@ -24,6 +24,7 @@ import { SendFileView } from '../../../models/view/sendFileView';
import { SendTextView } from '../../../models/view/sendTextView';
import { SendView } from '../../../models/view/sendView';
import { CipherArrayBuffer } from '../../../models/domain/cipherArrayBuffer';
import { Send } from '../../../models/domain/send';
// TimeOption is used for the dropdown implementation of custom times
@@ -385,7 +386,7 @@ export class AddEditComponent implements OnInit {
return this.sendService.get(this.sendId);
}
protected async encryptSend(file: File): Promise<[Send, ArrayBuffer]> {
protected async encryptSend(file: File): Promise<[Send, CipherArrayBuffer]> {
const sendData = await this.sendService.encrypt(this.send, file, this.password, null);
// Parse dates