diff --git a/ElementX/Sources/Application/AppSettings.swift b/ElementX/Sources/Application/AppSettings.swift index 44a07da5f..d2985c8c7 100644 --- a/ElementX/Sources/Application/AppSettings.swift +++ b/ElementX/Sources/Application/AppSettings.swift @@ -11,7 +11,7 @@ import SwiftUI // Common settings between app and NSE protocol CommonSettingsProtocol { var logLevel: TracingConfiguration.LogLevel { get } - var invisibleCryptoEnabled: Bool { get } + var enableOnlySignedDeviceIsolationMode: Bool { get } } /// Store Element specific app settings. @@ -43,7 +43,7 @@ final class AppSettings { case publicSearchEnabled case fuzzyRoomListSearchEnabled case pinningEnabled - case invisibleCryptoEnabled + case enableOnlySignedDeviceIsolationMode } private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier @@ -285,9 +285,9 @@ final class AppSettings { @UserPreference(key: UserDefaultsKeys.logLevel, defaultValue: TracingConfiguration.LogLevel.info, storageType: .userDefaults(store)) var logLevel - /// Configuration to enable invisible crypto. In this mode only devices signed by their owner will be considered in e2ee rooms. - @UserPreference(key: UserDefaultsKeys.invisibleCryptoEnabled, defaultValue: false, storageType: .userDefaults(store)) - var invisibleCryptoEnabled + /// Configuration to enable only signed device isolation mode for crypto. In this mode only devices signed by their owner will be considered in e2ee rooms. + @UserPreference(key: UserDefaultsKeys.enableOnlySignedDeviceIsolationMode, defaultValue: false, storageType: .userDefaults(store)) + var enableOnlySignedDeviceIsolationMode } extension AppSettings: CommonSettingsProtocol { } diff --git a/ElementX/Sources/Other/Extensions/ClientBuilder.swift b/ElementX/Sources/Other/Extensions/ClientBuilder.swift index 586fa4c20..957eb852d 100644 --- a/ElementX/Sources/Other/Extensions/ClientBuilder.swift +++ b/ElementX/Sources/Other/Extensions/ClientBuilder.swift @@ -15,7 +15,7 @@ extension ClientBuilder { slidingSync: ClientBuilderSlidingSync, sessionDelegate: ClientSessionDelegate, appHooks: AppHooks, - invisibleCryptoEnabled: Bool) -> ClientBuilder { + enableOnlySignedDeviceIsolationMode: Bool) -> ClientBuilder { var builder = ClientBuilder() .enableCrossProcessRefreshLock(processId: InfoPlistReader.main.bundleIdentifier, sessionDelegate: sessionDelegate) .userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent()) @@ -34,7 +34,7 @@ extension ClientBuilder { .backupDownloadStrategy(backupDownloadStrategy: .afterDecryptionFailure) .autoEnableBackups(autoEnableBackups: true) - if invisibleCryptoEnabled { + if enableOnlySignedDeviceIsolationMode { builder = builder.roomKeyRecipientStrategy(strategy: CollectStrategy.identityBasedStrategy) } else { builder = builder.roomKeyRecipientStrategy(strategy: .deviceBasedStrategy(onlyAllowTrustedDevices: false, errorOnVerifiedUserProblem: true)) diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index 8ad26e512..8a3d11809 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -47,7 +47,7 @@ protocol DeveloperOptionsProtocol: AnyObject { var elementCallBaseURLOverride: URL? { get set } var fuzzyRoomListSearchEnabled: Bool { get set } var pinningEnabled: Bool { get set } - var invisibleCryptoEnabled: Bool { get set } + var enableOnlySignedDeviceIsolationMode: Bool { get set } } extension AppSettings: DeveloperOptionsProtocol { } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index 7f9217f66..24152f5be 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -53,14 +53,14 @@ struct DeveloperOptionsScreen: View { } Section { - Toggle(isOn: $context.invisibleCryptoEnabled) { - Text("Enabled Invisible Crypto") + Toggle(isOn: $context.enableOnlySignedDeviceIsolationMode) { + Text("Exclude not secure devices when sending/receiving messages") Text("Requires app reboot") } } header: { Text("Trust and Decoration") } footer: { - Text("This setting controls how end-to-end encryption (E2EE) keys are shared. Enabling it will prevent the inclusion of devices that have not been explicitly verified by their owners.") + Text("This setting controls how end-to-end encryption (E2EE) keys are exchanged. Enabling it will prevent the inclusion of devices that have not been explicitly verified by their owners.") } Section { diff --git a/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift b/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift index dee843b5f..1c448eae9 100644 --- a/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift +++ b/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift @@ -78,7 +78,7 @@ struct AuthenticationClientBuilder: AuthenticationClientBuilderProtocol { slidingSync: slidingSync, sessionDelegate: clientSessionDelegate, appHooks: appHooks, - invisibleCryptoEnabled: appSettings.invisibleCryptoEnabled) + enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode) .sessionPaths(dataPath: sessionDirectories.dataPath, cachePath: sessionDirectories.cachePath) .passphrase(passphrase: passphrase) diff --git a/ElementX/Sources/Services/UserSession/UserSessionStore.swift b/ElementX/Sources/Services/UserSession/UserSessionStore.swift index ab38d90a9..310475032 100644 --- a/ElementX/Sources/Services/UserSession/UserSessionStore.swift +++ b/ElementX/Sources/Services/UserSession/UserSessionStore.swift @@ -125,7 +125,7 @@ class UserSessionStore: UserSessionStoreProtocol { slidingSync: .restored, sessionDelegate: keychainController, appHooks: appHooks, - invisibleCryptoEnabled: appSettings.invisibleCryptoEnabled) + enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode) .sessionPaths(dataPath: credentials.restorationToken.sessionDirectories.dataPath, cachePath: credentials.restorationToken.sessionDirectories.cachePath) .username(username: credentials.userID) diff --git a/NSE/Sources/Other/NSEUserSession.swift b/NSE/Sources/Other/NSEUserSession.swift index 54e915f19..6a2d99dbc 100644 --- a/NSE/Sources/Other/NSEUserSession.swift +++ b/NSE/Sources/Other/NSEUserSession.swift @@ -34,7 +34,7 @@ final class NSEUserSession { slidingSync: .restored, sessionDelegate: clientSessionDelegate, appHooks: appHooks, - invisibleCryptoEnabled: appSettings.invisibleCryptoEnabled) + enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode) .sessionPaths(dataPath: credentials.restorationToken.sessionDirectories.dataPath, cachePath: credentials.restorationToken.sessionDirectories.cachePath) .username(username: credentials.userID)