From 1733ec7b7faf43c25ea0c36e5139eaa1b1e1136e Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:49:56 +0100 Subject: [PATCH] Remove redundant checks on `global.Olm` (#4301) These routines don't use Olm, and we shouldn't be checking for it. --- src/crypto/key_passphrase.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/crypto/key_passphrase.ts b/src/crypto/key_passphrase.ts index 85c325eb9..bdd6b5263 100644 --- a/src/crypto/key_passphrase.ts +++ b/src/crypto/key_passphrase.ts @@ -36,10 +36,6 @@ interface IKey { } export function keyFromAuthData(authData: IAuthData, password: string): Promise { - 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 { - if (!global.Olm) { - throw new Error("Olm is not available"); - } - const salt = randomString(32); const key = await deriveKey(password, salt, DEFAULT_ITERATIONS, DEFAULT_BITSIZE);