Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Convert

Manav Rathi9e1b1b085045
diff --git a/web/packages/gallery/services/upload/upload-service.ts b/web/packages/gallery/services/upload/upload-service.ts
index b31d981821..dd00f3cca7 100644
--- a/web/packages/gallery/services/upload/upload-service.ts
+++ b/web/packages/gallery/services/upload/upload-service.ts
@@ -1425,7 +1425,7 @@ const constructPublicMagicMetadata = async (
const encryptFile = async (
file: FileWithMetadata,
- encryptionKey: string,
+ collectionKey: string,
worker: CryptoWorker,
) => {
const fileKey = await worker.generateBlobOrStreamKey();
@@ -1467,7 +1467,7 @@ const encryptFile = async (
};
}
- const encryptedKey = await worker.encryptToB64(fileKey, encryptionKey);
+ const encryptedFileKey = await worker.encryptBox(fileKey, collectionKey);
return {
encryptedFilePieces: {
@@ -1478,10 +1478,7 @@ const encryptFile = async (
pubMagicMetadata: encryptedPubMagicMetadata,
localID: localID,
},
- encryptedFileKey: {
- encryptedData: encryptedKey.encryptedData,
- nonce: encryptedKey.nonce,
- },
+ encryptedFileKey,
};
};