Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8113.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Respect the secure backup methods setting
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class BootstrapSetupRecoveryKeyFragment :
views.bootstrapSetupSecureSubmit.isVisible = false

// Choose between create a passphrase or use a recovery key
renderBackupMethodActions(firstFormStep.methods)
renderBackupMethodActions(state.secureBackupMethod)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
copy(
step = BootstrapStep.FirstForm(
keyBackUpExist = false,
reset = session.sharedSecretStorageService().isRecoverySetup(),
methods = this.secureBackupMethod
reset = session.sharedSecretStorageService().isRecoverySetup()
)
)
}
Expand All @@ -134,7 +133,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
// we just resume plain bootstrap
doesKeyBackupExist = false
setState {
copy(step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod))
copy(step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist))
}
} else {
// we need to get existing backup passphrase/key and convert to SSSS
Expand All @@ -148,7 +147,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
doesKeyBackupExist = true
isBackupCreatedFromPassphrase = keyVersion.getAuthDataAsMegolmBackupAuthData()?.privateKeySalt != null
setState {
copy(step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod))
copy(step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist))
}
}
}
Expand Down Expand Up @@ -496,7 +495,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
} else {
setState {
copy(
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod),
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist),
// Also reset the passphrase
passphrase = null,
passphraseRepeat = null,
Expand All @@ -509,7 +508,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
is BootstrapStep.SetupPassphrase -> {
setState {
copy(
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod),
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist),
// Also reset the passphrase
passphrase = null,
passphraseRepeat = null
Expand All @@ -530,7 +529,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
// Go back to the first step
setState {
copy(
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod),
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist),
// Also reset the passphrase
passphrase = null,
passphraseRepeat = null
Expand Down Expand Up @@ -563,7 +562,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
is BootstrapStep.GetBackupSecretForMigration -> {
setState {
copy(
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist, methods = this.secureBackupMethod),
step = BootstrapStep.FirstForm(keyBackUpExist = doesKeyBackupExist),
// Also reset the passphrase
passphrase = null,
passphraseRepeat = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ sealed class BootstrapStep {
object CheckingMigration : BootstrapStep()

// Use will be asked to choose between passphrase or recovery key, or to start process if a key backup exists
data class FirstForm(val keyBackUpExist: Boolean, val reset: Boolean = false, val methods: SecureBackupMethod) : BootstrapStep()
data class FirstForm(val keyBackUpExist: Boolean, val reset: Boolean = false) : BootstrapStep()

object SetupPassphrase : BootstrapStep()
object ConfirmPassphrase : BootstrapStep()
Expand Down