Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 490746e

Browse files
authored
Update to use non deprecated methods to derive key from passphrase (#55)
* Replace `deriveKey` call by `deriveRecoveryKeyFromPassphrase` * Remove `matrix-js-sdk/src/crypto/key_passphrase` import of eslint exception
1 parent 4776f87 commit 490746e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ module.exports = {
122122
"!matrix-js-sdk/src/crypto/aes",
123123
"!matrix-js-sdk/src/crypto/keybackup",
124124
"!matrix-js-sdk/src/crypto/deviceinfo",
125-
"!matrix-js-sdk/src/crypto/key_passphrase",
126125
"!matrix-js-sdk/src/crypto/recoverykey",
127126
"!matrix-js-sdk/src/crypto/dehydration",
128127
"!matrix-js-sdk/src/oidc",

src/SecurityManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
77
*/
88

99
import { ICryptoCallbacks, SecretStorage } from "matrix-js-sdk/src/matrix";
10-
import { deriveKey } from "matrix-js-sdk/src/crypto/key_passphrase";
10+
import { deriveRecoveryKeyFromPassphrase } from "matrix-js-sdk/src/crypto-api";
1111
import { decodeRecoveryKey } from "matrix-js-sdk/src/crypto/recoverykey";
1212
import { logger } from "matrix-js-sdk/src/logger";
1313

@@ -64,7 +64,7 @@ function makeInputToKey(
6464
): (keyParams: KeyParams) => Promise<Uint8Array> {
6565
return async ({ passphrase, recoveryKey }): Promise<Uint8Array> => {
6666
if (passphrase) {
67-
return deriveKey(passphrase, keyInfo.passphrase.salt, keyInfo.passphrase.iterations);
67+
return deriveRecoveryKeyFromPassphrase(passphrase, keyInfo.passphrase.salt, keyInfo.passphrase.iterations);
6868
} else if (recoveryKey) {
6969
return decodeRecoveryKey(recoveryKey);
7070
}

0 commit comments

Comments
 (0)