1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-07 23:02:56 +03:00

Remove redundant checks on global.Olm (#4301)

These routines don't use Olm, and we shouldn't be checking for it.
This commit is contained in:
Richard van der Hoff
2024-07-04 16:49:56 +01:00
committed by GitHub
parent 03ed4f5dd7
commit 1733ec7b7f

View File

@@ -36,10 +36,6 @@ interface IKey {
}
export function keyFromAuthData(authData: IAuthData, password: string): Promise<Uint8Array> {
if (!global.Olm) {
throw new Error("Olm is not available");
}
if (!authData.private_key_salt || !authData.private_key_iterations) {
throw new Error("Salt and/or iterations not found: " + "this backup cannot be restored with a passphrase");
}
@@ -53,10 +49,6 @@ export function keyFromAuthData(authData: IAuthData, password: string): Promise<
}
export async function keyFromPassphrase(password: string): Promise<IKey> {
if (!global.Olm) {
throw new Error("Olm is not available");
}
const salt = randomString(32);
const key = await deriveKey(password, salt, DEFAULT_ITERATIONS, DEFAULT_BITSIZE);