Attachments: support for incrementalMac and chunkSize

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2024-10-09 15:31:32 -05:00 committed by GitHub
parent 4834e3ddc2
commit aaf9e1a418
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 322 additions and 69 deletions

View file

@ -94,6 +94,7 @@ export async function attemptToReencryptToOriginalDigest(
attachment.path
),
},
needIncrementalMac: false,
getAbsoluteAttachmentPath:
window.Signal.Migrations.getAbsoluteAttachmentPath,
});
@ -117,6 +118,7 @@ export async function attemptToReencryptToOriginalDigest(
encryptAttachmentV2({
plaintext: {
stream: passthrough,
size: attachment.size,
},
keys: fromBase64(key),
dangerousIv: {
@ -124,6 +126,7 @@ export async function attemptToReencryptToOriginalDigest(
reason: 'reencrypting-for-backup',
digestToMatch: fromBase64(digest),
},
needIncrementalMac: false,
getAbsoluteAttachmentPath:
window.Signal.Migrations.getAbsoluteAttachmentPath,
}),
@ -146,6 +149,7 @@ export async function generateNewEncryptionInfoForAttachment(
attachment.path
),
},
needIncrementalMac: false,
getAbsoluteAttachmentPath:
window.Signal.Migrations.getAbsoluteAttachmentPath,
});
@ -170,7 +174,9 @@ export async function generateNewEncryptionInfoForAttachment(
keys: newKeys,
plaintext: {
stream: passthrough,
size: attachment.size,
},
needIncrementalMac: false,
getAbsoluteAttachmentPath:
window.Signal.Migrations.getAbsoluteAttachmentPath,
}),