tsc
This commit is contained in:
parent
4b896d3aab
commit
ad96f679c9
1 changed files with 4 additions and 3 deletions
|
@ -11,7 +11,7 @@ import type { KeyAttributes, User } from "../user/types";
|
|||
|
||||
export interface VerifyMasterPasswordFormProps {
|
||||
user: User;
|
||||
keyAttributes: KeyAttributes;
|
||||
keyAttributes: KeyAttributes | undefined;
|
||||
callback: (
|
||||
key: string,
|
||||
kek: string,
|
||||
|
@ -48,14 +48,15 @@ export default function VerifyMasterPasswordForm({
|
|||
srpAttributes.opsLimit,
|
||||
srpAttributes.memLimit,
|
||||
);
|
||||
} else {
|
||||
} else if (keyAttributes) {
|
||||
kek = await cryptoWorker.deriveKey(
|
||||
passphrase,
|
||||
keyAttributes.kekSalt,
|
||||
keyAttributes.opsLimit,
|
||||
keyAttributes.memLimit,
|
||||
);
|
||||
}
|
||||
} else
|
||||
throw new Error("Both SRP and key attributes are missing");
|
||||
} catch (e) {
|
||||
log.error("failed to derive key", e);
|
||||
throw Error(CustomError.WEAK_DEVICE);
|
||||
|
|
Loading…
Add table
Reference in a new issue