mirror of
https://github.com/bitwarden/browser
synced 2026-02-06 11:43:51 +00:00
Fix comments
This commit is contained in:
@@ -22,7 +22,7 @@ export abstract class MasterPasswordServiceAbstraction {
|
||||
abstract forceSetPasswordReason$: (userId: UserId) => Observable<ForceSetPasswordReason>;
|
||||
/**
|
||||
* An observable that emits the master key for the user.
|
||||
* @deprecated Interacting with the master-key directly is deprecated. Please use {@link makeMasterPasswordUnlockData} and {@link makeMasterPasswordAuthenticationData}, {@link unwrapUserKeyFromMasterPasswordUnlockData}, or {@link makeMasterKeyWrappedUserKey} instead.
|
||||
* @deprecated Interacting with the master-key directly is deprecated. Please use {@link makeMasterPasswordUnlockData} and {@link makeMasterPasswordAuthenticationData}, {@link unwrapUserKeyFromMasterPasswordUnlockData} instead.
|
||||
* @param userId The user ID.
|
||||
* @throws If the user ID is missing.
|
||||
*/
|
||||
|
||||
@@ -260,21 +260,8 @@ export class MasterPasswordService implements InternalMasterPasswordServiceAbstr
|
||||
salt: MasterPasswordSalt,
|
||||
userKey: UserKey,
|
||||
): Promise<MasterPasswordUnlockData> {
|
||||
return {
|
||||
salt,
|
||||
kdf,
|
||||
masterKeyWrappedUserKey: await this.makeMasterKeyWrappedUserKey(password, kdf, salt, userKey),
|
||||
};
|
||||
}
|
||||
|
||||
async makeMasterKeyWrappedUserKey(
|
||||
password: string,
|
||||
kdf: KdfConfig,
|
||||
salt: MasterPasswordSalt,
|
||||
userKey: UserKey,
|
||||
): Promise<MasterKeyWrappedUserKey> {
|
||||
await SdkLoadService.Ready;
|
||||
return new EncString(
|
||||
const masterKeyWrappedUserKey = new EncString(
|
||||
PureCrypto.encrypt_user_key_with_master_password(
|
||||
userKey.toEncoded(),
|
||||
password,
|
||||
@@ -282,6 +269,11 @@ export class MasterPasswordService implements InternalMasterPasswordServiceAbstr
|
||||
kdf.toSdkConfig(),
|
||||
),
|
||||
) as MasterKeyWrappedUserKey;
|
||||
return {
|
||||
salt,
|
||||
kdf,
|
||||
masterKeyWrappedUserKey,
|
||||
};
|
||||
}
|
||||
|
||||
async unwrapUserKeyFromMasterPasswordUnlockData(
|
||||
|
||||
@@ -210,7 +210,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Please use `makeMasterKeyWrappedUserKey` in {@link MasterPasswordService} instead.
|
||||
* @deprecated Please use `makeMasterPasswordUnlockData` in {@link MasterPasswordService} instead.
|
||||
*/
|
||||
async makeUserKey(masterKey: MasterKey | null): Promise<[UserKey, EncString]> {
|
||||
if (masterKey == null) {
|
||||
@@ -258,7 +258,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
|
||||
|
||||
// TODO: Move to MasterPasswordService
|
||||
/**
|
||||
* @deprecated Please use `makeMasterPasswordAuthenticationData`, `unwrapMasterKeyWrappedUserKey` or `makeMasterKeyWrappedUserKey` in @link MasterPasswordService instead.
|
||||
* @deprecated Please use `makeMasterPasswordAuthenticationData`, `unwrapUserKeyFromMasterPasswordUnlockData` or `makeMasterPasswordUnlockData` in @link MasterPasswordService instead.
|
||||
*/
|
||||
async getOrDeriveMasterKey(password: string, userId?: UserId) {
|
||||
const [resolvedUserId, email] = await firstValueFrom(
|
||||
@@ -287,7 +287,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
|
||||
/**
|
||||
* Derive a master key from a password and email.
|
||||
*
|
||||
* @deprecated Please use `makeMasterPasswordAuthenticationData`, `unwrapMasterKeyWrappedUserKey` or `makeMasterKeyWrappedUserKey` in @link MasterPasswordService instead.
|
||||
* @deprecated Please use `makeMasterPasswordAuthenticationData`, `makeMasterPasswordAuthenticationData`, `unwrapUserKeyFromMasterPasswordUnlockData` in @link MasterPasswordService instead.
|
||||
*
|
||||
* @remarks
|
||||
* Does not validate the kdf config to ensure it satisfies the minimum requirements for the given kdf type.
|
||||
@@ -307,7 +307,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Please use `makeMasterKeyWrappedUserKey` in {@link MasterPasswordService} instead.
|
||||
* @deprecated Please use `makeMasterPasswordUnlockData` in {@link MasterPasswordService} instead.
|
||||
*/
|
||||
async encryptUserKeyWithMasterKey(
|
||||
masterKey: MasterKey,
|
||||
|
||||
Reference in New Issue
Block a user