CW-566-Cake2FA-Bypass-Bug (#1275)

* fix: TOTP 2FA Bug

* fix: key switch error

* Fix 2fa preset issue

---------

Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
Adegoke David 2024-01-27 04:08:53 +01:00 committed by GitHub
parent fc352a6da3
commit f68987bfb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -997,7 +997,7 @@ abstract class SettingsStoreBase with Store {
final totpSecretKey = await SecureKey.getString( final totpSecretKey = await SecureKey.getString(
secureStorage: secureStorage, secureStorage: secureStorage,
sharedPreferences: sharedPreferences, sharedPreferences: sharedPreferences,
key: SecureKey.useTOTP2FA, key: SecureKey.totpSecretKey,
) ?? ) ??
''; '';
@ -1243,7 +1243,7 @@ abstract class SettingsStoreBase with Store {
totpSecretKey = await SecureKey.getString( totpSecretKey = await SecureKey.getString(
secureStorage: _secureStorage, secureStorage: _secureStorage,
sharedPreferences: sharedPreferences, sharedPreferences: sharedPreferences,
key: SecureKey.useTOTP2FA, key: SecureKey.totpSecretKey,
) ?? ) ??
totpSecretKey; totpSecretKey;

View file

@ -27,7 +27,9 @@ abstract class Setup2FAViewModelBase with Store {
unhighlightTabs = false, unhighlightTabs = false,
selected2FASettings = ObservableList<VerboseControlSettings>(), selected2FASettings = ObservableList<VerboseControlSettings>(),
state = InitialExecutionState() { state = InitialExecutionState() {
selectCakePreset(selectedCake2FAPreset); if (selectedCake2FAPreset != Cake2FAPresetsOptions.none) {
selectCakePreset(selectedCake2FAPreset);
}
reaction((_) => state, _saveLastAuthTime); reaction((_) => state, _saveLastAuthTime);
} }