Skip to content

Commit 23ab453

Browse files
authored
crypto: rename invisible crypto flag to deviceIsolationMode (#3331)
1 parent dc6d7f2 commit 23ab453

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

ElementX/Sources/Application/AppSettings.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SwiftUI
1111
// Common settings between app and NSE
1212
protocol CommonSettingsProtocol {
1313
var logLevel: TracingConfiguration.LogLevel { get }
14-
var invisibleCryptoEnabled: Bool { get }
14+
var enableOnlySignedDeviceIsolationMode: Bool { get }
1515
}
1616

1717
/// Store Element specific app settings.
@@ -43,7 +43,7 @@ final class AppSettings {
4343
case publicSearchEnabled
4444
case fuzzyRoomListSearchEnabled
4545
case pinningEnabled
46-
case invisibleCryptoEnabled
46+
case enableOnlySignedDeviceIsolationMode
4747
}
4848

4949
private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier
@@ -285,9 +285,9 @@ final class AppSettings {
285285
@UserPreference(key: UserDefaultsKeys.logLevel, defaultValue: TracingConfiguration.LogLevel.info, storageType: .userDefaults(store))
286286
var logLevel
287287

288-
/// Configuration to enable invisible crypto. In this mode only devices signed by their owner will be considered in e2ee rooms.
289-
@UserPreference(key: UserDefaultsKeys.invisibleCryptoEnabled, defaultValue: false, storageType: .userDefaults(store))
290-
var invisibleCryptoEnabled
288+
/// 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.
289+
@UserPreference(key: UserDefaultsKeys.enableOnlySignedDeviceIsolationMode, defaultValue: false, storageType: .userDefaults(store))
290+
var enableOnlySignedDeviceIsolationMode
291291
}
292292

293293
extension AppSettings: CommonSettingsProtocol { }

ElementX/Sources/Other/Extensions/ClientBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension ClientBuilder {
1515
slidingSync: ClientBuilderSlidingSync,
1616
sessionDelegate: ClientSessionDelegate,
1717
appHooks: AppHooks,
18-
invisibleCryptoEnabled: Bool) -> ClientBuilder {
18+
enableOnlySignedDeviceIsolationMode: Bool) -> ClientBuilder {
1919
var builder = ClientBuilder()
2020
.enableCrossProcessRefreshLock(processId: InfoPlistReader.main.bundleIdentifier, sessionDelegate: sessionDelegate)
2121
.userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent())
@@ -34,7 +34,7 @@ extension ClientBuilder {
3434
.backupDownloadStrategy(backupDownloadStrategy: .afterDecryptionFailure)
3535
.autoEnableBackups(autoEnableBackups: true)
3636

37-
if invisibleCryptoEnabled {
37+
if enableOnlySignedDeviceIsolationMode {
3838
builder = builder.roomKeyRecipientStrategy(strategy: CollectStrategy.identityBasedStrategy)
3939
} else {
4040
builder = builder.roomKeyRecipientStrategy(strategy: .deviceBasedStrategy(onlyAllowTrustedDevices: false, errorOnVerifiedUserProblem: true))

ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protocol DeveloperOptionsProtocol: AnyObject {
4747
var elementCallBaseURLOverride: URL? { get set }
4848
var fuzzyRoomListSearchEnabled: Bool { get set }
4949
var pinningEnabled: Bool { get set }
50-
var invisibleCryptoEnabled: Bool { get set }
50+
var enableOnlySignedDeviceIsolationMode: Bool { get set }
5151
}
5252

5353
extension AppSettings: DeveloperOptionsProtocol { }

ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ struct DeveloperOptionsScreen: View {
5353
}
5454

5555
Section {
56-
Toggle(isOn: $context.invisibleCryptoEnabled) {
57-
Text("Enabled Invisible Crypto")
56+
Toggle(isOn: $context.enableOnlySignedDeviceIsolationMode) {
57+
Text("Exclude not secure devices when sending/receiving messages")
5858
Text("Requires app reboot")
5959
}
6060
} header: {
6161
Text("Trust and Decoration")
6262
} footer: {
63-
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.")
63+
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.")
6464
}
6565

6666
Section {

ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct AuthenticationClientBuilder: AuthenticationClientBuilderProtocol {
7878
slidingSync: slidingSync,
7979
sessionDelegate: clientSessionDelegate,
8080
appHooks: appHooks,
81-
invisibleCryptoEnabled: appSettings.invisibleCryptoEnabled)
81+
enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode)
8282
.sessionPaths(dataPath: sessionDirectories.dataPath,
8383
cachePath: sessionDirectories.cachePath)
8484
.passphrase(passphrase: passphrase)

ElementX/Sources/Services/UserSession/UserSessionStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class UserSessionStore: UserSessionStoreProtocol {
125125
slidingSync: .restored,
126126
sessionDelegate: keychainController,
127127
appHooks: appHooks,
128-
invisibleCryptoEnabled: appSettings.invisibleCryptoEnabled)
128+
enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode)
129129
.sessionPaths(dataPath: credentials.restorationToken.sessionDirectories.dataPath,
130130
cachePath: credentials.restorationToken.sessionDirectories.cachePath)
131131
.username(username: credentials.userID)

NSE/Sources/Other/NSEUserSession.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class NSEUserSession {
3434
slidingSync: .restored,
3535
sessionDelegate: clientSessionDelegate,
3636
appHooks: appHooks,
37-
invisibleCryptoEnabled: appSettings.invisibleCryptoEnabled)
37+
enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode)
3838
.sessionPaths(dataPath: credentials.restorationToken.sessionDirectories.dataPath,
3939
cachePath: credentials.restorationToken.sessionDirectories.cachePath)
4040
.username(username: credentials.userID)

0 commit comments

Comments
 (0)