mirror of
https://github.com/bitwarden/browser
synced 2026-01-31 08:43:54 +00:00
Build with the ability to create attachments without keys
This commit is contained in:
@@ -6,6 +6,7 @@ export class AttachmentResponse {
|
||||
size: string;
|
||||
sizeName: string;
|
||||
url: string;
|
||||
key: any;
|
||||
|
||||
constructor(o: AttachmentView) {
|
||||
this.id = o.id;
|
||||
@@ -13,5 +14,6 @@ export class AttachmentResponse {
|
||||
this.size = o.size;
|
||||
this.sizeName = o.sizeName;
|
||||
this.url = o.url;
|
||||
this.key = o.key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1096,15 +1096,15 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
|
||||
const encFileName = await this.encryptService.encryptString(filename, cipherEncKey);
|
||||
|
||||
const dataEncKey = await this.keyService.makeDataEncKey(cipherEncKey);
|
||||
const encData = await this.encryptService.encryptFileData(new Uint8Array(data), dataEncKey[0]);
|
||||
// const dataEncKey = await this.keyService.makeDataEncKey(cipherEncKey);
|
||||
const encData = await this.encryptService.encryptFileData(new Uint8Array(data), cipherEncKey);
|
||||
|
||||
const response = await this.cipherFileUploadService.upload(
|
||||
cipher,
|
||||
encFileName,
|
||||
encData,
|
||||
admin,
|
||||
dataEncKey,
|
||||
null, //dataEncKey,
|
||||
);
|
||||
|
||||
const cData = new CipherData(response, cipher.collectionIds);
|
||||
|
||||
@@ -29,7 +29,8 @@ export class CipherFileUploadService implements CipherFileUploadServiceAbstracti
|
||||
dataEncKey: [SymmetricCryptoKey, EncString],
|
||||
): Promise<CipherResponse> {
|
||||
const request: AttachmentRequest = {
|
||||
key: dataEncKey[1].encryptedString,
|
||||
// key: dataEncKey[1].encryptedString,
|
||||
key: undefined as any,
|
||||
fileName: encFileName.encryptedString,
|
||||
fileSize: encData.buffer.byteLength,
|
||||
adminRequest: admin,
|
||||
|
||||
Reference in New Issue
Block a user