mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Discard invalid incrementalMacs
This commit is contained in:
@@ -674,7 +674,7 @@ export class Bootstrap {
|
||||
return join(this.#storagePath, 'attachments.noindex', relativePath);
|
||||
}
|
||||
|
||||
public async storeAttachmentOnCDN(
|
||||
public async encryptAndStoreAttachmentOnCDN(
|
||||
data: Buffer,
|
||||
contentType: MIMEType
|
||||
): Promise<Proto.IAttachmentPointer> {
|
||||
@@ -684,13 +684,13 @@ export class Bootstrap {
|
||||
|
||||
const passthrough = new PassThrough();
|
||||
|
||||
const [{ digest }] = await Promise.all([
|
||||
const [{ digest, chunkSize, incrementalMac }] = await Promise.all([
|
||||
encryptAttachmentV2({
|
||||
keys,
|
||||
plaintext: {
|
||||
data,
|
||||
},
|
||||
needIncrementalMac: false,
|
||||
needIncrementalMac: true,
|
||||
sink: passthrough,
|
||||
}),
|
||||
this.server.storeAttachmentOnCdn(cdnNumber, cdnKey, passthrough),
|
||||
@@ -703,6 +703,8 @@ export class Bootstrap {
|
||||
cdnNumber,
|
||||
key: keys,
|
||||
digest,
|
||||
chunkSize,
|
||||
incrementalMac,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user