From cf81072ff375ca1286eee6a890cb950c01db8f32 Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 8 Oct 2024 16:25:34 +0200 Subject: [PATCH] crypto: Configure decryption trustRequirement based on config flag (#3358) * crypto: Configure decryption trustRequirement based on config flag * quick review --- ElementX/Sources/Other/Extensions/ClientBuilder.swift | 8 ++++++-- .../View/DeveloperOptionsScreen.swift | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ElementX/Sources/Other/Extensions/ClientBuilder.swift b/ElementX/Sources/Other/Extensions/ClientBuilder.swift index 957eb852d..6abce9a3b 100644 --- a/ElementX/Sources/Other/Extensions/ClientBuilder.swift +++ b/ElementX/Sources/Other/Extensions/ClientBuilder.swift @@ -35,9 +35,13 @@ extension ClientBuilder { .autoEnableBackups(autoEnableBackups: true) if enableOnlySignedDeviceIsolationMode { - builder = builder.roomKeyRecipientStrategy(strategy: CollectStrategy.identityBasedStrategy) + builder = builder + .roomKeyRecipientStrategy(strategy: .identityBasedStrategy) + .roomDecryptionTrustRequirement(trustRequirement: .crossSignedOrLegacy) } else { - builder = builder.roomKeyRecipientStrategy(strategy: .deviceBasedStrategy(onlyAllowTrustedDevices: false, errorOnVerifiedUserProblem: true)) + builder = builder + .roomKeyRecipientStrategy(strategy: .deviceBasedStrategy(onlyAllowTrustedDevices: false, errorOnVerifiedUserProblem: true)) + .roomDecryptionTrustRequirement(trustRequirement: .untrusted) } } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index 683b0a1f1..878efcb09 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -53,7 +53,7 @@ struct DeveloperOptionsScreen: View { Section { Toggle(isOn: $context.enableOnlySignedDeviceIsolationMode) { - Text("Exclude not secure devices when sending/receiving messages") + Text("Exclude insecure devices when sending/receiving messages") Text("Requires app reboot") } } header: {