You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When issuing New-KeePassPassword, if switches or parameters are passed to the function that do not affect the characterset, the underlying library throws an exception of TooFewCharacters
For example New-KeePassPassword -Length 16 will throw and exception, whereas New-KeePassPassword -UpperCase -Length 16 works.
A proposed solution - define a variable where $defaultCharSet with a value "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" early in the function then replace line 229 ($PassProfile.CharSet.Add($NewProfileObject.CharacterSet)) as follows - note that the proposed solution allows for a minimum number of characters needed to select from for generation (in this case looking for empty "-lt 1") but minimum length could be set higher. This could prevent from just sending something like New-KeePassPassword -Minus which would, by default, generate 20 dashes as the password.
#Check if a minimum of characters available to process otherwise set computed character setIf ($NewProfileObject.CharacterSet.Length-lt1)
{
$NewProfileObject.CharacterSet=$NewProfileObject.CharacterSet+$defaultCharSet$PassProfile.CharSet.Add($NewProfileObject.CharacterSet)
}
The text was updated successfully, but these errors were encountered:
When issuing New-KeePassPassword, if switches or parameters are passed to the function that do not affect the characterset, the underlying library throws an exception of TooFewCharacters
For example New-KeePassPassword -Length 16 will throw and exception, whereas New-KeePassPassword -UpperCase -Length 16 works.
A proposed solution - define a variable where $defaultCharSet with a value "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" early in the function then replace line 229 ($PassProfile.CharSet.Add($NewProfileObject.CharacterSet)) as follows - note that the proposed solution allows for a minimum number of characters needed to select from for generation (in this case looking for empty "-lt 1") but minimum length could be set higher. This could prevent from just sending something like New-KeePassPassword -Minus which would, by default, generate 20 dashes as the password.
The text was updated successfully, but these errors were encountered: