Skip to content

Commit

Permalink
crypto: Configure decryption trustRequirement based on config flag (#…
Browse files Browse the repository at this point in the history
…3358)

* crypto: Configure decryption trustRequirement based on config flag

* quick review
  • Loading branch information
BillCarsonFr authored Oct 8, 2024
1 parent c087ece commit cf81072
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions ElementX/Sources/Other/Extensions/ClientBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit cf81072

Please sign in to comment.