Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cppack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
passwords
cppack
Commits
aa4b3e01
Commit
aa4b3e01
authored
Feb 3, 2020
by
Mathieu Valois
Browse files
Options
Downloads
Patches
Plain Diff
simplify updateMinMax
parent
8b099e10
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/Statsgen.cpp
+9
-28
9 additions, 28 deletions
src/core/Statsgen.cpp
with
9 additions
and
28 deletions
src/core/Statsgen.cpp
+
9
−
28
View file @
aa4b3e01
...
...
@@ -322,33 +322,14 @@ PasswordStats analyze_password(const string & password, SecurityRules & sr, cons
}
void
updateMinMax
(
minMax
&
m
,
const
Policy
&
pol
)
{
if
(
m
.
mindigit
==
-
1
||
m
.
mindigit
>
pol
.
digit
)
{
m
.
mindigit
=
pol
.
digit
;
}
if
(
m
.
maxdigit
==
-
1
||
m
.
maxdigit
<
pol
.
digit
)
{
m
.
maxdigit
=
pol
.
digit
;
}
if
(
m
.
minlower
==
-
1
||
m
.
minlower
>
pol
.
lower
)
{
m
.
minlower
=
pol
.
lower
;
}
if
(
m
.
maxlower
==
-
1
||
m
.
maxlower
<
pol
.
lower
)
{
m
.
maxlower
=
pol
.
lower
;
}
if
(
m
.
minupper
==
-
1
||
m
.
minupper
>
pol
.
upper
)
{
m
.
minupper
=
pol
.
upper
;
}
if
(
m
.
maxupper
==
-
1
||
m
.
maxupper
<
pol
.
upper
)
{
m
.
maxupper
=
pol
.
upper
;
}
if
(
m
.
minspecial
==
-
1
||
m
.
minspecial
>
pol
.
special
)
{
m
.
minspecial
=
pol
.
special
;
}
if
(
m
.
maxspecial
==
-
1
||
m
.
maxspecial
<
pol
.
special
)
{
m
.
maxspecial
=
pol
.
special
;
}
m
.
mindigit
=
min
(
m
.
mindigit
,
pol
.
digit
);
m
.
maxdigit
=
max
(
m
.
maxdigit
,
pol
.
digit
);
m
.
minlower
=
min
(
m
.
minlower
,
pol
.
lower
);
m
.
maxlower
=
max
(
m
.
maxlower
,
pol
.
lower
);
m
.
minupper
=
min
(
m
.
minupper
,
pol
.
upper
);
m
.
maxupper
=
max
(
m
.
maxupper
,
pol
.
upper
);
m
.
minspecial
=
min
(
m
.
minspecial
,
pol
.
special
);
m
.
maxspecial
=
max
(
m
.
maxspecial
,
pol
.
special
);
}
void
handle_password
(
const
string
&
password
,
const
uint64_t
&
nbPasswords
,
thread_data
*
my_data
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment