Skip to content

Commit 4319a42

Browse files
authored
Merge pull request #3569 from element-hq/feature/valere/only_signed_decryption_mode
crypto: Use OnlySigned isolation flag to setup decryption trust req.
2 parents 779c6db + 3259539 commit 4319a42

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ enum class FeatureFlags(
125125
),
126126
OnlySignedDeviceIsolationMode(
127127
key = "feature.onlySignedDeviceIsolationMode",
128-
title = "Exclude not secure devices when sending/receiving messages",
128+
title = "Exclude insecure devices when sending/receiving messages",
129129
description = "This setting controls how end-to-end encryption (E2E) keys are shared." +
130130
" Enabling it will prevent the inclusion of devices that have not been explicitly verified by their owners." +
131131
" You'll have to stop and re-open the app manually for that setting to take effect.",

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactory.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import org.matrix.rustcomponents.sdk.SlidingSyncVersionBuilder
3232
import org.matrix.rustcomponents.sdk.use
3333
import timber.log.Timber
3434
import uniffi.matrix_sdk_crypto.CollectStrategy
35+
import uniffi.matrix_sdk_crypto.TrustRequirement
3536
import java.io.File
3637
import javax.inject.Inject
3738

@@ -108,6 +109,13 @@ class RustMatrixClientFactory @Inject constructor(
108109
CollectStrategy.DeviceBasedStrategy(onlyAllowTrustedDevices = false, errorOnVerifiedUserProblem = true)
109110
}
110111
)
112+
.roomDecryptionTrustRequirement(
113+
trustRequirement = if (featureFlagService.isFeatureEnabled(FeatureFlags.OnlySignedDeviceIsolationMode)) {
114+
TrustRequirement.CROSS_SIGNED_OR_LEGACY
115+
} else {
116+
TrustRequirement.UNTRUSTED
117+
}
118+
)
111119
.run {
112120
// Apply sliding sync version settings
113121
when (slidingSyncType) {

0 commit comments

Comments
 (0)