This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import * as StorageManager from './utils/StorageManager';
3434import IdentityAuthClient from './IdentityAuthClient' ;
3535import { crossSigningCallbacks , tryToUnlockSecretStorageWithDehydrationKey } from './SecurityManager' ;
3636import { SHOW_QR_CODE_METHOD } from "matrix-js-sdk/src/crypto/verification/QRCode" ;
37+ import SecurityCustomisations from "./customisations/Security" ;
3738
3839export interface IMatrixClientCreds {
3940 homeserverUrl : string ;
@@ -273,7 +274,10 @@ class _MatrixClientPeg implements IMatrixClientPeg {
273274 // These are always installed regardless of the labs flag so that
274275 // cross-signing features can toggle on without reloading and also be
275276 // accessed immediately after login.
276- Object . assign ( opts . cryptoCallbacks , crossSigningCallbacks ) ;
277+ const customisatedCallbacks = {
278+ getDehydrationKey : SecurityCustomisations . getDehydrationKey ,
279+ } ;
280+ Object . assign ( opts . cryptoCallbacks , crossSigningCallbacks , customisatedCallbacks ) ;
277281
278282 this . matrixClient = createMatrixClient ( opts ) ;
279283
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ function getSecretStorageKey(): Uint8Array {
4444 return null ;
4545}
4646
47+ /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
48+ function getDehydrationKey (
49+ keyInfo : ISecretStorageKeyInfo ,
50+ ) : Promise < Uint8Array > {
51+ return Promise . resolve ( null ) ;
52+ }
53+
4754/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
4855function catchAccessSecretStorageError ( e : Error ) : void {
4956 // E.g. notify the user in some way
@@ -74,6 +81,9 @@ export interface ISecurityCustomisations {
7481 setupEncryptionNeeded ?: (
7582 kind : SetupEncryptionKind ,
7683 ) => boolean ,
84+ getDehydrationKey ?: (
85+ keyInfo : ISecretStorageKeyInfo ,
86+ ) => Promise < Uint8Array > ,
7787}
7888
7989// A real customisation module will define and export one or more of the
You can’t perform that action at this time.
0 commit comments