Store IV when encrypting or decrypting attachments

This commit is contained in:
trevor-signal 2024-05-22 00:07:39 -04:00 committed by GitHub
parent 63be4299f4
commit e9b661873b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 136 additions and 11 deletions

View file

@ -132,7 +132,7 @@ export async function downloadAttachment(
window.Signal.Migrations.getAbsoluteAttachmentPath(downloadedPath);
const { aesKey, macKey } = splitKeys(Bytes.fromBase64(key));
const { path, plaintextHash } = await decryptAttachmentV2({
const { path, plaintextHash, iv } = await decryptAttachmentV2({
ciphertextPath: cipherTextAbsolutePath,
idForLogging: logId,
aesKey,
@ -155,6 +155,7 @@ export async function downloadAttachment(
? MIME.stringToMIMEType(contentType)
: MIME.APPLICATION_OCTET_STREAM,
plaintextHash,
iv: Bytes.toBase64(iv),
};
}