File tree 2 files changed +2
-5
lines changed
2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,8 @@ limitations under the License.
15
15
*/
16
16
17
17
import DOMException from "domexception" ;
18
- import * as crypto from "crypto" ;
19
18
20
19
global . DOMException = DOMException as typeof global . DOMException ;
21
- // Set node crypto into global.crypto
22
- // Needed in `CryptoApi#createRecoveryKeyFromPassphrase` and `crypto/crypto.ts`
23
- global . crypto = crypto . webcrypto as typeof global . crypto ;
24
20
25
21
jest . mock ( "../src/http-api/utils" , ( ) => ( {
26
22
...jest . requireActual ( "../src/http-api/utils" ) ,
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ import { CrossSigningIdentity } from "./CrossSigningIdentity";
46
46
import { secretStorageContainsCrossSigningKeys } from "./secret-storage" ;
47
47
import { keyFromPassphrase } from "../crypto/key_passphrase" ;
48
48
import { encodeRecoveryKey } from "../crypto/recoverykey" ;
49
+ import { crypto } from "../crypto/crypto" ;
49
50
50
51
/**
51
52
* An implementation of {@link CryptoBackend} using the Rust matrix-sdk-crypto.
@@ -426,7 +427,7 @@ export class RustCrypto implements CryptoBackend {
426
427
} else {
427
428
// Using the navigator crypto API to generate the private key
428
429
privateKey = new Uint8Array ( 32 ) ;
429
- global . crypto . getRandomValues ( privateKey ) ;
430
+ crypto . getRandomValues ( privateKey ) ;
430
431
}
431
432
432
433
const encodedPrivateKey = encodeRecoveryKey ( privateKey ) ;
You can’t perform that action at this time.
0 commit comments