From c09672ff886b5c861644dbae107a088ca606bdfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Bispo?= Date: Thu, 20 Jul 2023 15:30:29 +0100 Subject: [PATCH 1/2] [PM-1208] Fix app resource file --- src/App/Resources/AppResources.resx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index f7c1be34b..cf4c0e952 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -2675,6 +2675,7 @@ Do you want to switch to this account? Vault timeout action changed to log out + Block auto-fill From c0688c584efcc4f6035d958527babeeb0f190135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Bispo?= Date: Thu, 20 Jul 2023 15:37:08 +0100 Subject: [PATCH 2/2] [PM-1208] Fix merge --- .../SettingsPage/SettingsPageViewModel.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs b/src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs index 2ab8ccbd5..b8ae2f557 100644 --- a/src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs +++ b/src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs @@ -151,7 +151,7 @@ namespace Bit.App.Pages } var pinSet = await _vaultTimeoutService.IsPinLockSetAsync(); - _pin = pinSet.Item1 || pinSet.Item2; + _pin = pinSet != PinLockEnum.Disabled; _biometric = await _vaultTimeoutService.IsBiometricLockSetAsync(); _screenCaptureAllowed = await _stateService.GetScreenCaptureAllowedAsync(); @@ -452,19 +452,20 @@ namespace Bit.App.Pages var kdfConfig = await _stateService.GetActiveUserCustomDataAsync(a => new KdfConfig(a?.Profile)); var email = await _stateService.GetEmailAsync(); - var pinKey = await _cryptoService.MakePinKeyAysnc(pin, email, kdfConfig); - var key = await _cryptoService.GetKeyAsync(); - var pinProtectedKey = await _cryptoService.EncryptAsync(key.Key, pinKey); + var pinKey = await _cryptoService.MakePinKeyAsync(pin, email, kdfConfig); + var userKey = await _cryptoService.GetUserKeyAsync(); + var pinProtectedKey = await _cryptoService.EncryptAsync(userKey.Key, pinKey); + + var encPin = await _cryptoService.EncryptAsync(pin); + await _stateService.SetProtectedPinAsync(encPin.EncryptedString); if (masterPassOnRestart) { - var encPin = await _cryptoService.EncryptAsync(pin); - await _stateService.SetProtectedPinAsync(encPin.EncryptedString); - await _stateService.SetPinProtectedKeyAsync(pinProtectedKey); + await _stateService.SetUserKeyPinEphemeralAsync(pinProtectedKey); } else { - await _stateService.SetPinProtectedAsync(pinProtectedKey.EncryptedString); + await _stateService.SetUserKeyPinAsync(pinProtectedKey); } } else @@ -508,7 +509,7 @@ namespace Bit.App.Pages await UpdateVaultTimeoutActionIfNeededAsync(); } await _stateService.SetBiometricLockedAsync(false); - await _cryptoService.ToggleKeyAsync(); + await _cryptoService.ToggleKeysAsync(); BuildList(); }