Skip to content

Commit 1733ec7

Browse files
authored
Remove redundant checks on global.Olm (#4301)
These routines don't use Olm, and we shouldn't be checking for it.
1 parent 03ed4f5 commit 1733ec7

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/crypto/key_passphrase.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ interface IKey {
3636
}
3737

3838
export function keyFromAuthData(authData: IAuthData, password: string): Promise<Uint8Array> {
39-
if (!global.Olm) {
40-
throw new Error("Olm is not available");
41-
}
42-
4339
if (!authData.private_key_salt || !authData.private_key_iterations) {
4440
throw new Error("Salt and/or iterations not found: " + "this backup cannot be restored with a passphrase");
4541
}
@@ -53,10 +49,6 @@ export function keyFromAuthData(authData: IAuthData, password: string): Promise<
5349
}
5450

5551
export async function keyFromPassphrase(password: string): Promise<IKey> {
56-
if (!global.Olm) {
57-
throw new Error("Olm is not available");
58-
}
59-
6052
const salt = randomString(32);
6153

6254
const key = await deriveKey(password, salt, DEFAULT_ITERATIONS, DEFAULT_BITSIZE);

0 commit comments

Comments
 (0)