mirror of
https://github.com/bitwarden/mobile
synced 2025-12-22 11:13:49 +00:00
[SG-460] Master Password security checks (mobile) (#2312)
* [SG-886] MasterPassword Strength Indicator (#2238) * [SG-886] Add password strength indicator control * [SG-570] Add weak password dialog check * [SG-886] rename enum password strength * [SG-886] Change control scale * [SG-886] Move calculate user inputs to IPasswordGenerationService, refactor. * [SG-886] Move formatted string to xaml. Move minimum chars to constant * [SG-886] String to enum converter * [SG-886] PR fixes. Code refactor control * [SG-886] Update UI on OS theme change. * [SG-886] Move colors to view * [SG-886] Fixed password strength validation * [SG-564][SG-565] Check Exposed Password (#2239) * [SG-886] Add password strength indicator control * [SG-570] Add weak password dialog check * [SG-886] rename enum password strength * [SG-564] [SG-565] Add check for exposed password and show dialog * code format * [SG-886] Change control scale * [SG-886] Move calculate user inputs to IPasswordGenerationService, refactor. * [SG-886] Move formatted string to xaml. Move minimum chars to constant * [SG-886] String to enum converter * [SG-886] Remove import * [SG-886] Update UI on OS theme change. * [SG-886] Move colors to view * [SG-886] Fixed password strength validation
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Abstractions;
|
||||
using Bit.App.Resources;
|
||||
using Bit.App.Utilities;
|
||||
using Bit.Core;
|
||||
using Bit.Core.Abstractions;
|
||||
using Bit.Core.Enums;
|
||||
@@ -137,8 +138,8 @@ namespace Bit.App.Pages
|
||||
}
|
||||
if (IsPolicyInEffect)
|
||||
{
|
||||
var userInput = await GetPasswordStrengthUserInput();
|
||||
var passwordStrength = _passwordGenerationService.PasswordStrength(MasterPassword, userInput);
|
||||
var userInputs = _passwordGenerationService.GetPasswordStrengthUserInput(await _stateService.GetEmailAsync());
|
||||
var passwordStrength = _passwordGenerationService.PasswordStrength(MasterPassword, userInputs);
|
||||
if (!await _policyService.EvaluateMasterPassword(passwordStrength.Score, MasterPassword, Policy))
|
||||
{
|
||||
await Page.DisplayAlert(AppResources.MasterPasswordPolicyValidationTitle,
|
||||
@@ -148,7 +149,7 @@ namespace Bit.App.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MasterPassword.Length < 8)
|
||||
if (MasterPassword.Length < Constants.MasterPasswordMinimumChars)
|
||||
{
|
||||
await Page.DisplayAlert(AppResources.MasterPasswordPolicyValidationTitle,
|
||||
AppResources.MasterPasswordLengthValMessage, AppResources.Ok);
|
||||
|
||||
Reference in New Issue
Block a user