Skip to content

armgit / ente

Public Imported from GitHub
0

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

Use majority terminology in more places

Manav Rathia6428608e620
diff --git a/web/packages/accounts/components/VerifyMasterPasswordForm.tsx b/web/packages/accounts/components/VerifyMasterPasswordForm.tsx
index 23e172510c..02439ab2ac 100644
--- a/web/packages/accounts/components/VerifyMasterPasswordForm.tsx
+++ b/web/packages/accounts/components/VerifyMasterPasswordForm.tsx
@@ -49,7 +49,7 @@ export interface VerifyMasterPasswordFormProps {
* auxillary information that was ascertained when verifying it.
*
* @param key The user's master key obtained after decrypting it by using
- * the KEK derived from their passphrase.
+ * the KEK derived from their password.
*
* @param kek The key used for encrypting the user's master key.
*
@@ -57,15 +57,15 @@ export interface VerifyMasterPasswordFormProps {
* started with, or those that we fetched on the way using
* {@link getKeyAttributes}).
*
- * @param passphrase The plaintext passphrase. This can be used during login
- * to derive another encrypted key using interactive mem/ops limits for
- * faster reauthentication after the initial login.
+ * @param password The plaintext password. This can be used during login to
+ * derive another encrypted key using interactive mem/ops limits for faster
+ * reauthentication after the initial login.
*/
onVerify: (
key: string,
kek: string,
keyAttributes: KeyAttributes,
- passphrase: string,
+ password: string,
) => void;
}
@@ -102,16 +102,16 @@ export const VerifyMasterPasswordForm: React.FC<
}
try {
- await verifyPassphrase(password, setPasswordFieldError);
+ await verifyPassword(password, setPasswordFieldError);
} catch (e) {
- log.error("Failed to to verify passphrase", e);
+ log.error("Failed to to verify password", e);
setPasswordFieldError(t("generic_error"));
}
},
});
- const verifyPassphrase = async (
- passphrase: string,
+ const verifyPassword = async (
+ password: string,
setFieldError: (message: string) => void,
) => {
const cryptoWorker = await sharedCryptoWorker();
@@ -119,7 +119,7 @@ export const VerifyMasterPasswordForm: React.FC<
if (srpAttributes) {
try {
kek = await cryptoWorker.deriveKey(
- passphrase,
+ password,
srpAttributes.kekSalt,
srpAttributes.opsLimit,
srpAttributes.memLimit,
@@ -132,7 +132,7 @@ export const VerifyMasterPasswordForm: React.FC<
} else if (keyAttributes) {
try {
kek = await cryptoWorker.deriveKey(
- passphrase,
+ password,
keyAttributes.kekSalt,
keyAttributes.opsLimit,
keyAttributes.memLimit,
@@ -184,7 +184,7 @@ export const VerifyMasterPasswordForm: React.FC<
return;
}
- onVerify(key, kek, keyAttributes, passphrase);
+ onVerify(key, kek, keyAttributes, password);
};
return (
diff --git a/web/packages/accounts/pages/credentials.tsx b/web/packages/accounts/pages/credentials.tsx
index 02dc0e52b4..26138c480d 100644
--- a/web/packages/accounts/pages/credentials.tsx
+++ b/web/packages/accounts/pages/credentials.tsx
@@ -241,11 +241,11 @@ const Page: React.FC = () => {
};
const handleVerifyMasterPassword: VerifyMasterPasswordFormProps["onVerify"] =
- (key, kek, keyAttributes, passphrase) => {
+ (key, kek, keyAttributes, password) => {
void (async () => {
const updatedKeyAttributes = isFirstLogin()
? await generateAndSaveInteractiveKeyAttributes(
- passphrase,
+ password,
keyAttributes,
key,
)
diff --git a/web/packages/accounts/services/srp.ts b/web/packages/accounts/services/srp.ts
index 02d91289d9..e3bb047a8f 100644
--- a/web/packages/accounts/services/srp.ts
+++ b/web/packages/accounts/services/srp.ts
@@ -22,8 +22,8 @@ import type { UserVerificationResponse } from "./user";
*
* The SRP (Secure Remote Password) protocol is a modified Diffie-Hellman key
* exchange that allows the remote to verify the user's possession of a
- * passphrase, and the user to ensure that remote is not being impersonated,
- * without the passphrase ever leaving the device.
+ * password, and the user to ensure that remote is not being impersonated,
+ * without the password ever leaving the device.
*
* It is used as an (user selectable) alternative to email verification.
*
@@ -88,7 +88,7 @@ import type { UserVerificationResponse } from "./user";
*
* SRP setup is now complete.
*
- * A similar flow is used when the user changes their passphrase. On passphrase
+ * A similar flow is used when the user changes their password. On password
* change, a new KEK is generated, thus the SRP password also changes, and so a
* subset of the steps above are done to update both client and remote.
*
@@ -150,19 +150,19 @@ export interface SRPAttributes {
*/
srpSalt: string;
/**
- * The mem limit used during the KEK derivation from the passphrase.
+ * The mem limit used during the KEK derivation from the password.
*
* See also the discussion in {@link kekSalt}.
*/
memLimit: number;
/**
- * The ops limit used during the KEK derivation from the passphrase.
+ * The ops limit used during the KEK derivation from the password.
*
* See also the discussion in {@link kekSalt}.
*/
opsLimit: number;
/**
- * The salt used during the KEK derivation from the passphrase.
+ * The salt used during the KEK derivation from the password.
*
* Base64 encoded.
*
diff --git a/web/packages/accounts/services/user.ts b/web/packages/accounts/services/user.ts
index a573cf5c72..e529c95f2b 100644
--- a/web/packages/accounts/services/user.ts
+++ b/web/packages/accounts/services/user.ts
@@ -169,11 +169,11 @@ export interface KeyAttributes {
* The user's master key is encrypted with a "key encryption key" (lovingly
* called a "KEK" sometimes).
*
- * The KEK itself is derived from the user's passphrase.
+ * The KEK itself is derived from the user's password.
*
- * 1. User enters passphrase on new device.
+ * 1. User enters password on new device.
*
- * 2. Client derives KEK from this passphrase (using the {@link kekSalt},
+ * 2. Client derives KEK from this password (using the {@link kekSalt},
* {@link opsLimit} and {@link memLimit} as parameters for the
* derivation).
*
@@ -197,7 +197,7 @@ export interface KeyAttributes {
* [Note: KEK three tuple]
*
* The three tuple (kekSalt, opsLimit, memLimit) is needed (along with the
- * user's passphrase) to rederive the KEK when the user logs in on a new
+ * user's password) to rederive the KEK when the user logs in on a new
* client (See: [Note: Key encryption key]).
*
* The client can obtain these three by fetching their key attributes from
@@ -275,7 +275,7 @@ export interface KeyAttributes {
* Base64 encoded.
*
* This allows the user to recover their master key if they forget their
- * passphrase but still have their recovery key.
+ * password but still have their recovery key.
*
* Note: This value doesn't change after being initially created.
*/
@@ -359,13 +359,13 @@ export const saveKeyAttributes = (keyAttributes: KeyAttributes) =>
/**
* Generate a new set of key attributes.
*
- * @param passphrase The passphrase to use for deriving the key encryption key.
+ * @param password The password to use for deriving the key encryption key.
*
* @returns a newly generated master key (base64 string), kek (base64 string)
* and the key attributes associated with the combination.
*/
export async function generateKeysAndAttributes(
- passphrase: string,
+ password: string,
): Promise<{ masterKey: string; kek: string; keyAttributes: KeyAttributes }> {
const masterKey = await generateKey();
const recoveryKey = await generateKey();
@@ -374,7 +374,7 @@ export async function generateKeysAndAttributes(
salt: kekSalt,
opsLimit,
memLimit,
- } = await deriveSensitiveKey(passphrase);
+ } = await deriveSensitiveKey(password);
const { encryptedData: encryptedKey, nonce: keyDecryptionNonce } =
await encryptBox(masterKey, kek);
@@ -588,10 +588,10 @@ export const remoteLogoutIfNeeded = async () => {
*
* See {@link deriveInteractiveKey} for more details.
*
- * In brief, after the initial passphrase verification, we create a new
- * inetractive KEK derived from the same passphrase as the original KEK, but
- * with so called interactive mem and ops limits which result in a noticeably
- * faster key derivation.
+ * In brief, after the initial password verification, we create a new
+ * inetractive KEK derived from the same password as the original KEK, but with
+ * so called interactive mem and ops limits which result in a noticeably faster
+ * key derivation.
*
* We then overwrite the encrypted master key, encryption nonce and the KEK
* derivation parameters (see: [Note: KEK three tuple]) in the locally persisted
@@ -599,11 +599,11 @@ export const remoteLogoutIfNeeded = async () => {
* subsequent reauthentication.
*
* These are more ergonomic for the user especially in the web app where they
- * need to enter their passphrase to access their masterKey when repopening the
+ * need to enter their password to access their masterKey when repopening the
* app in a new tab (on desktop we can avoid this by using OS storage, see
* [Note: Safe storage and interactive KEK attributes]).
*
- * @param passphrase The user's passphrase.
+ * @param password The user's password.
*
* @param keyAttributes The existing "original" key attributes, which we
* might've generated locally (new signup) or fetched from remote (existing
@@ -614,7 +614,7 @@ export const remoteLogoutIfNeeded = async () => {
* @returns the update key attributes.
*/
export const generateAndSaveInteractiveKeyAttributes = async (
- passphrase: string,
+ password: string,
keyAttributes: KeyAttributes,
key: string,
): Promise<KeyAttributes> => {
@@ -623,7 +623,7 @@ export const generateAndSaveInteractiveKeyAttributes = async (
salt: kekSalt,
opsLimit,
memLimit,
- } = await deriveInteractiveKey(passphrase);
+ } = await deriveInteractiveKey(password);
const { encryptedData: encryptedKey, nonce: keyDecryptionNonce } =
await encryptBox(key, interactiveKEK);