Store plaintext hash with newly sent or received attachments

This commit is contained in:
trevor-signal 2023-11-17 15:02:02 -05:00 committed by GitHub
parent 48245eeea6
commit b7ab1d7207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 19 deletions

View file

@ -116,7 +116,7 @@ export async function downloadAttachmentV2(
const cipherTextAbsolutePath =
window.Signal.Migrations.getAbsoluteAttachmentPath(cipherTextRelativePath);
const relativePath = await decryptAttachmentV2({
const { path, plaintextHash } = await decryptAttachmentV2({
ciphertextPath: cipherTextAbsolutePath,
id: cdn,
keys: Bytes.fromBase64(key),
@ -130,11 +130,12 @@ export async function downloadAttachmentV2(
return {
...omit(attachment, 'key'),
path: relativePath,
path,
size,
contentType: contentType
? MIME.stringToMIMEType(contentType)
: MIME.APPLICATION_OCTET_STREAM,
plaintextHash,
};
}