From 85155a43bbadde96f4239181401f3b394debd75a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 26 Jan 2022 10:17:31 +0100 Subject: [PATCH] cleanup types --- src/matrix/e2ee/megolm/keybackup/Curve25519.ts | 2 +- src/matrix/e2ee/megolm/keybackup/KeyBackup.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/matrix/e2ee/megolm/keybackup/Curve25519.ts b/src/matrix/e2ee/megolm/keybackup/Curve25519.ts index 9a453b5a..f1345bc6 100644 --- a/src/matrix/e2ee/megolm/keybackup/Curve25519.ts +++ b/src/matrix/e2ee/megolm/keybackup/Curve25519.ts @@ -28,7 +28,7 @@ export type BackupInfo = BaseBackupInfo & { auth_data: AuthData, } -export type AuthData = { +type AuthData = { public_key: string, signatures: SignatureMap } diff --git a/src/matrix/e2ee/megolm/keybackup/KeyBackup.ts b/src/matrix/e2ee/megolm/keybackup/KeyBackup.ts index dc541cf2..f4c7b28b 100644 --- a/src/matrix/e2ee/megolm/keybackup/KeyBackup.ts +++ b/src/matrix/e2ee/megolm/keybackup/KeyBackup.ts @@ -24,7 +24,6 @@ import type {IncomingRoomKey, RoomKey} from "../decryption/RoomKey"; import type {KeyLoader} from "../decryption/KeyLoader"; import type {SecretStorage} from "../../../ssss/SecretStorage"; import type {Storage} from "../../../storage/idb/Storage"; -import type {DeviceIdentity} from "../../../storage/idb/stores/DeviceIdentityStore"; import type {ILogItem} from "../../../../logging/types"; import type {Platform} from "../../../../platform/web/Platform"; import type {Transaction} from "../../../storage/idb/Transaction"; @@ -46,13 +45,13 @@ type OtherBackupInfo = BaseBackupInfo & { }; type BackupInfo = Curve25519.BackupInfo | OtherBackupInfo; -type AuthData = Curve25519.AuthData; +type SessionData = Curve25519.SessionData; type SessionInfo = { first_message_index: number, forwarded_count: number, is_verified: boolean, - session_data: Curve25519.SessionData | any + session_data: SessionData } type MegOlmSessionKeyInfo = { @@ -63,6 +62,7 @@ type MegOlmSessionKeyInfo = { session_key: string } +// the type that session_data decrypts from / encrypts to export type SessionKeyInfo = MegOlmSessionKeyInfo | {algorithm: string}; type KeyBackupPayload = {