Convert attachments to filePointers for backup export

This commit is contained in:
trevor-signal 2024-05-15 10:55:20 -04:00 committed by GitHub
parent ad94fef92d
commit 6f7545926a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 876 additions and 194 deletions

View file

@ -40,7 +40,7 @@ import {
KEY_SET_LENGTH,
_generateAttachmentIv,
decryptAttachmentV2,
encryptAttachmentV2,
encryptAttachmentV2ToDisk,
getAesCbcCiphertextLength,
splitKeys,
} from '../AttachmentCrypto';
@ -607,7 +607,7 @@ describe('Crypto', () => {
let ciphertextPath;
try {
const encryptedAttachment = await encryptAttachmentV2({
const encryptedAttachment = await encryptAttachmentV2ToDisk({
keys,
plaintextAbsolutePath: FILE_PATH,
});
@ -655,7 +655,7 @@ describe('Crypto', () => {
let ciphertextPath;
try {
const encryptedAttachment = await encryptAttachmentV2({
const encryptedAttachment = await encryptAttachmentV2ToDisk({
keys,
plaintextAbsolutePath: sourcePath,
});
@ -700,7 +700,7 @@ describe('Crypto', () => {
let ciphertextPath;
try {
const encryptedAttachment = await encryptAttachmentV2({
const encryptedAttachment = await encryptAttachmentV2ToDisk({
keys,
plaintextAbsolutePath: FILE_PATH,
});
@ -753,7 +753,7 @@ describe('Crypto', () => {
});
const ciphertextV1 = encryptedAttachmentV1.ciphertext;
const encryptedAttachmentV2 = await encryptAttachmentV2({
const encryptedAttachmentV2 = await encryptAttachmentV2ToDisk({
keys,
plaintextAbsolutePath: FILE_PATH,
dangerousTestOnlyIv,
@ -788,7 +788,7 @@ describe('Crypto', () => {
let outerCiphertextPath;
let innerEncryptedAttachment;
try {
innerEncryptedAttachment = await encryptAttachmentV2({
innerEncryptedAttachment = await encryptAttachmentV2ToDisk({
keys: innerKeys,
plaintextAbsolutePath,
});
@ -797,7 +797,7 @@ describe('Crypto', () => {
innerEncryptedAttachment.path
);
const outerEncryptedAttachment = await encryptAttachmentV2({
const outerEncryptedAttachment = await encryptAttachmentV2ToDisk({
keys: outerKeys,
plaintextAbsolutePath: innerCiphertextPath,
// We (and the server!) don't pad the second layer