Skip to content

armgit / ente

Public Imported from GitHub
0

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

feat: use encryption key for more entropy in reset secret

httpjamesmd4d2c6829997
diff --git a/web/apps/photos/src/components/Sidebar/UtilitySection.tsx b/web/apps/photos/src/components/Sidebar/UtilitySection.tsx
index 781e2bf371..8e00873c76 100644
--- a/web/apps/photos/src/components/Sidebar/UtilitySection.tsx
+++ b/web/apps/photos/src/components/Sidebar/UtilitySection.tsx
@@ -18,7 +18,10 @@ import {
import { APPS, CLIENT_PACKAGE_NAMES } from "@ente/shared/apps/constants";
import ThemeSwitcher from "@ente/shared/components/ThemeSwitcher";
import { getRecoveryKey } from "@ente/shared/crypto/helpers";
-import { encryptToB64 } from "@ente/shared/crypto/internal/libsodium";
+import {
+ encryptToB64,
+ generateEncryptionKey,
+} from "@ente/shared/crypto/internal/libsodium";
import { getAccountsURL } from "@ente/shared/network/api";
import { logError } from "@ente/shared/sentry";
import { THEME_COLOR } from "@ente/shared/themes/constants";
@@ -28,7 +31,6 @@ import isElectron from "is-electron";
import { getAccountsToken } from "services/userService";
import { getDownloadAppMessage } from "utils/ui";
import { isInternalUser } from "utils/user";
-import { v4 as uuidv4 } from "uuid";
import Preferences from "./Preferences";
export default function UtilitySection({ closeSidebar }) {
@@ -85,7 +87,7 @@ export default function UtilitySection({ closeSidebar }) {
// let's create the necessary recovery information
const recoveryKey = await getRecoveryKey();
- const resetSecret = uuidv4();
+ const resetSecret = await generateEncryptionKey();
const encryptionResult = await encryptToB64(
resetSecret,