Skip to content

armgit / ente

Public Imported from GitHub
0

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

Swap

Manav Rathi7112e96c75b9
diff --git a/web/packages/shared/crypto/helpers.ts b/web/packages/shared/crypto/helpers.ts
index 21ab4357d2..db434c0920 100644
--- a/web/packages/shared/crypto/helpers.ts
+++ b/web/packages/shared/crypto/helpers.ts
@@ -150,17 +150,16 @@ export const getRecoveryKey = async () => {
* @returns a new base64 encoded recovery key.
*/
const createNewRecoveryKey = async () => {
- const masterKey = await getActualKey();
+ const masterKey = await masterKeyFromSession();
const existingAttributes = getData("keyAttributes");
const cryptoWorker = await sharedCryptoWorker();
-
const recoveryKey = await cryptoWorker.generateKey();
- const encryptedMasterKey = await cryptoWorker.encryptToB64(
+ const encryptedMasterKey = await cryptoWorker.encryptBoxB64(
masterKey,
recoveryKey,
);
- const encryptedRecoveryKey = await cryptoWorker.encryptToB64(
+ const encryptedRecoveryKey = await cryptoWorker.encryptBoxB64(
recoveryKey,
masterKey,
);