Store IV when encrypting or decrypting attachments

This commit is contained in:
trevor-signal
2024-05-28 21:12:14 -04:00
committed by GitHub
parent 1d5690acba
commit 85a75cb28f
6 changed files with 136 additions and 11 deletions
+2 -1
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),
};
}