Merge pull request #2704 from element-hq/feature/bma/encryptDbRelease
Encrypt new session data with a passphrase
This commit is contained in:
1
changelog.d/2703.misc
Normal file
1
changelog.d/2703.misc
Normal file
@@ -0,0 +1 @@
|
||||
Encrypt new session data with a passphrase
|
||||
@@ -19,8 +19,6 @@ package io.element.android.libraries.matrix.impl.auth
|
||||
import com.squareup.anvil.annotations.ContributesBinding
|
||||
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
||||
import io.element.android.libraries.core.extensions.mapFailure
|
||||
import io.element.android.libraries.core.meta.BuildMeta
|
||||
import io.element.android.libraries.core.meta.BuildType
|
||||
import io.element.android.libraries.di.AppScope
|
||||
import io.element.android.libraries.di.SingleIn
|
||||
import io.element.android.libraries.matrix.api.MatrixClient
|
||||
@@ -60,7 +58,6 @@ class RustMatrixAuthenticationService @Inject constructor(
|
||||
private val passphraseGenerator: PassphraseGenerator,
|
||||
userCertificatesProvider: UserCertificatesProvider,
|
||||
proxyProvider: ProxyProvider,
|
||||
private val buildMeta: BuildMeta,
|
||||
) : MatrixAuthenticationService {
|
||||
// Passphrase which will be used for new sessions. Existing sessions will use the passphrase
|
||||
// stored in the SessionData.
|
||||
@@ -110,13 +107,6 @@ class RustMatrixAuthenticationService @Inject constructor(
|
||||
}
|
||||
|
||||
private fun getDatabasePassphrase(): String? {
|
||||
// TODO Remove this if block at some point
|
||||
// Return a passphrase only for debug and nightly build for now
|
||||
if (buildMeta.buildType == BuildType.RELEASE) {
|
||||
Timber.w("New sessions will not be encrypted with a passphrase (release build)")
|
||||
return null
|
||||
}
|
||||
|
||||
val passphrase = passphraseGenerator.generatePassphrase()
|
||||
if (passphrase != null) {
|
||||
Timber.w("New sessions will be encrypted with a passphrase")
|
||||
|
||||
@@ -64,7 +64,6 @@ class MainActivity : ComponentActivity() {
|
||||
utdTracker = UtdTracker(NoopAnalyticsService()),
|
||||
),
|
||||
passphraseGenerator = NullPassphraseGenerator(),
|
||||
buildMeta = Singleton.buildMeta,
|
||||
userCertificatesProvider = userCertificatesProvider,
|
||||
proxyProvider = proxyProvider,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user