From 64c301caebb19b70121a7d0a077af4c790b5a788 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 9 Feb 2018 22:02:56 -0500 Subject: [PATCH] password gen fixes --- src/App/Services/PasswordGenerationService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/App/Services/PasswordGenerationService.cs b/src/App/Services/PasswordGenerationService.cs index 3e833ba7c..7f19ad71a 100644 --- a/src/App/Services/PasswordGenerationService.cs +++ b/src/App/Services/PasswordGenerationService.cs @@ -29,8 +29,8 @@ namespace Bit.App.Services int? minNumbers = null, int? minSpecial = null) { - int minUppercaseValue = minUppercase.GetValueOrDefault(1), - minLowercaseValue = minLowercase.GetValueOrDefault(1), + int minUppercaseValue = minUppercase.GetValueOrDefault(0), + minLowercaseValue = minLowercase.GetValueOrDefault(0), minNumbersValue = minNumbers.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorMinNumbers, 1)), minSpecialValue = minSpecial.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorMinSpecial, 1)), lengthValue = length.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorLength, 10)); @@ -42,19 +42,19 @@ namespace Bit.App.Services ambiguousValue = ambiguous.GetValueOrDefault(_settings.GetValueOrDefault(Constants.PasswordGeneratorAmbiguous, false)); // Sanitize - if(uppercaseValue && minUppercaseValue < 0) + if(uppercaseValue && minUppercaseValue <= 0) { minUppercaseValue = 1; } - if(lowercaseValue && minLowercaseValue < 0) + if(lowercaseValue && minLowercaseValue <= 0) { minLowercaseValue = 1; } - if(numbersValue && minNumbersValue < 0) + if(numbersValue && minNumbersValue <= 0) { minNumbersValue = 1; } - if(specialValue && minSpecialValue < 0) + if(specialValue && minSpecialValue <= 0) { minSpecialValue = 1; }