Skip to content

Commit 3e52a4f

Browse files
committed
Encrypt new session data with a passphrase #2703
1 parent 42dd04f commit 3e52a4f

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

changelog.d/2703.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Encrypt new session data with a passphrase

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ package io.element.android.libraries.matrix.impl.auth
1919
import com.squareup.anvil.annotations.ContributesBinding
2020
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
2121
import io.element.android.libraries.core.extensions.mapFailure
22-
import io.element.android.libraries.core.meta.BuildMeta
23-
import io.element.android.libraries.core.meta.BuildType
2422
import io.element.android.libraries.di.AppScope
2523
import io.element.android.libraries.di.SingleIn
2624
import io.element.android.libraries.matrix.api.MatrixClient
@@ -60,7 +58,6 @@ class RustMatrixAuthenticationService @Inject constructor(
6058
private val passphraseGenerator: PassphraseGenerator,
6159
userCertificatesProvider: UserCertificatesProvider,
6260
proxyProvider: ProxyProvider,
63-
private val buildMeta: BuildMeta,
6461
) : MatrixAuthenticationService {
6562
// Passphrase which will be used for new sessions. Existing sessions will use the passphrase
6663
// stored in the SessionData.
@@ -110,13 +107,6 @@ class RustMatrixAuthenticationService @Inject constructor(
110107
}
111108

112109
private fun getDatabasePassphrase(): String? {
113-
// TODO Remove this if block at some point
114-
// Return a passphrase only for debug and nightly build for now
115-
if (buildMeta.buildType == BuildType.RELEASE) {
116-
Timber.w("New sessions will not be encrypted with a passphrase (release build)")
117-
return null
118-
}
119-
120110
val passphrase = passphraseGenerator.generatePassphrase()
121111
if (passphrase != null) {
122112
Timber.w("New sessions will be encrypted with a passphrase")

samples/minimal/src/main/kotlin/io/element/android/samples/minimal/MainActivity.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class MainActivity : ComponentActivity() {
6464
utdTracker = UtdTracker(NoopAnalyticsService()),
6565
),
6666
passphraseGenerator = NullPassphraseGenerator(),
67-
buildMeta = Singleton.buildMeta,
6867
userCertificatesProvider = userCertificatesProvider,
6968
proxyProvider = proxyProvider,
7069
)

0 commit comments

Comments
 (0)