crypto: Configure decryption trustRequirement based on config flag (#3358)

* crypto: Configure decryption trustRequirement based on config flag

* quick review
This commit is contained in:
Valere 2024-10-08 16:25:34 +02:00 committed by GitHub
parent c087ece3bb
commit cf81072ff3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -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)
}
}

View File

@ -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: {