mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-09-13 14:22:25 +03:00
upgrade to matrix-js-sdk v37.5.0 (#2327)
* upgrade to js-sdk 37 * fix server crypto wasm locally
This commit is contained in:
parent
6ddcf2cb02
commit
387ce9c462
8 changed files with 96 additions and 51 deletions
|
@ -1,7 +1,6 @@
|
|||
import React, { FormEventHandler, useCallback } from 'react';
|
||||
import { Box, Text, Button, Spinner, color } from 'folds';
|
||||
import { decodeRecoveryKey } from 'matrix-js-sdk/lib/crypto-api';
|
||||
import { deriveKey } from 'matrix-js-sdk/lib/crypto/key_passphrase';
|
||||
import { decodeRecoveryKey, deriveRecoveryKeyFromPassphrase } from 'matrix-js-sdk/lib/crypto-api';
|
||||
import { PasswordInput } from './password-input';
|
||||
import {
|
||||
SecretStorageKeyContent,
|
||||
|
@ -29,11 +28,16 @@ export function SecretStorageRecoveryPassphrase({
|
|||
const [driveKeyState, submitPassphrase] = useAsyncCallback<
|
||||
Uint8Array,
|
||||
Error,
|
||||
Parameters<typeof deriveKey>
|
||||
Parameters<typeof deriveRecoveryKeyFromPassphrase>
|
||||
>(
|
||||
useCallback(
|
||||
async (passphrase, salt, iterations, bits) => {
|
||||
const decodedRecoveryKey = await deriveKey(passphrase, salt, iterations, bits);
|
||||
const decodedRecoveryKey = await deriveRecoveryKeyFromPassphrase(
|
||||
passphrase,
|
||||
salt,
|
||||
iterations,
|
||||
bits
|
||||
);
|
||||
|
||||
const match = await mx.secretStorage.checkKey(decodedRecoveryKey, keyContent as any);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue