|
|
356b41 |
diff -up cracklib-2.9.0/lib/fascist.c.simplistic cracklib-2.9.0/lib/fascist.c
|
|
|
356b41 |
--- cracklib-2.9.0/lib/fascist.c.simplistic 2013-10-31 14:46:23.160959124 +0100
|
|
|
356b41 |
+++ cracklib-2.9.0/lib/fascist.c 2013-10-31 14:46:23.164959212 +0100
|
|
|
356b41 |
@@ -55,7 +55,6 @@ static char *r_destructors[] = {
|
|
|
356b41 |
|
|
|
356b41 |
"/?p@?p", /* purging out punctuation/symbols/junk */
|
|
|
356b41 |
"/?s@?s",
|
|
|
356b41 |
- "/?X@?X",
|
|
|
356b41 |
|
|
|
356b41 |
/* attempt reverse engineering of password strings */
|
|
|
356b41 |
|
|
|
356b41 |
@@ -454,6 +453,12 @@ GTry(rawtext, password)
|
|
|
356b41 |
continue;
|
|
|
356b41 |
}
|
|
|
356b41 |
|
|
|
356b41 |
+ if (len - strlen(mp) >= 3)
|
|
|
356b41 |
+ {
|
|
|
356b41 |
+ /* purged too much */
|
|
|
356b41 |
+ continue;
|
|
|
356b41 |
+ }
|
|
|
356b41 |
+
|
|
|
356b41 |
#ifdef DEBUG
|
|
|
356b41 |
printf("%-16s = %-16s (destruct %s)\n", mp, rawtext, r_destructors[i]);
|
|
|
356b41 |
#endif
|
|
|
356b41 |
@@ -480,6 +485,12 @@ GTry(rawtext, password)
|
|
|
356b41 |
continue;
|
|
|
356b41 |
}
|
|
|
356b41 |
|
|
|
356b41 |
+ if (len - strlen(mp) >= 3)
|
|
|
356b41 |
+ {
|
|
|
356b41 |
+ /* purged too much */
|
|
|
356b41 |
+ continue;
|
|
|
356b41 |
+ }
|
|
|
356b41 |
+
|
|
|
356b41 |
#ifdef DEBUG
|
|
|
356b41 |
printf("%-16s = %-16s (construct %s)\n", mp, password, r_constructors[i]);
|
|
|
356b41 |
#endif
|
|
|
356b41 |
@@ -699,6 +710,7 @@ FascistLookUser(PWDICT *pwp, char *instr
|
|
|
356b41 |
char rpassword[STRINGSIZE];
|
|
|
356b41 |
char area[STRINGSIZE];
|
|
|
356b41 |
uint32_t notfound;
|
|
|
356b41 |
+ int len;
|
|
|
356b41 |
|
|
|
356b41 |
notfound = PW_WORDS(pwp);
|
|
|
356b41 |
/* already truncated if from FascistCheck() */
|
|
|
356b41 |
@@ -748,6 +760,7 @@ FascistLookUser(PWDICT *pwp, char *instr
|
|
|
356b41 |
return _("it is all whitespace");
|
|
|
356b41 |
}
|
|
|
356b41 |
|
|
|
356b41 |
+ len = strlen(password);
|
|
|
356b41 |
i = 0;
|
|
|
356b41 |
ptr = password;
|
|
|
356b41 |
while (ptr[0] && ptr[1])
|
|
|
356b41 |
@@ -759,10 +772,9 @@ FascistLookUser(PWDICT *pwp, char *instr
|
|
|
356b41 |
ptr++;
|
|
|
356b41 |
}
|
|
|
356b41 |
|
|
|
356b41 |
- /* Change by Ben Karsin from ITS at University of Hawaii at Manoa. Static MAXSTEP
|
|
|
356b41 |
- would generate many false positives for long passwords. */
|
|
|
356b41 |
- maxrepeat = 3+(0.09*strlen(password));
|
|
|
356b41 |
- if (i > maxrepeat)
|
|
|
356b41 |
+ /* We were still generating false positives for long passwords.
|
|
|
356b41 |
+ Just count systematic double as a single character. */
|
|
|
356b41 |
+ if (len - i < MINLEN)
|
|
|
356b41 |
{
|
|
|
356b41 |
return _("it is too simplistic/systematic");
|
|
|
356b41 |
}
|
|
|
356b41 |
@@ -795,6 +807,12 @@ FascistLookUser(PWDICT *pwp, char *instr
|
|
|
356b41 |
continue;
|
|
|
356b41 |
}
|
|
|
356b41 |
|
|
|
356b41 |
+ if (len - strlen(a) >= 3)
|
|
|
356b41 |
+ {
|
|
|
356b41 |
+ /* purged too much */
|
|
|
356b41 |
+ continue;
|
|
|
356b41 |
+ }
|
|
|
356b41 |
+
|
|
|
356b41 |
#ifdef DEBUG
|
|
|
356b41 |
printf("%-16s (dict)\n", a);
|
|
|
356b41 |
#endif
|
|
|
356b41 |
@@ -815,6 +833,13 @@ FascistLookUser(PWDICT *pwp, char *instr
|
|
|
356b41 |
{
|
|
|
356b41 |
continue;
|
|
|
356b41 |
}
|
|
|
356b41 |
+
|
|
|
356b41 |
+ if (len - strlen(a) >= 3)
|
|
|
356b41 |
+ {
|
|
|
356b41 |
+ /* purged too much */
|
|
|
356b41 |
+ continue;
|
|
|
356b41 |
+ }
|
|
|
356b41 |
+
|
|
|
356b41 |
#ifdef DEBUG
|
|
|
356b41 |
printf("%-16s (reversed dict)\n", a);
|
|
|
356b41 |
#endif
|
|
|
356b41 |
diff -up cracklib-2.9.0/util/cracklib-format.simplistic cracklib-2.9.0/util/cracklib-format
|
|
|
356b41 |
--- cracklib-2.9.0/util/cracklib-format.simplistic 2013-06-01 16:47:13.000000000 +0200
|
|
|
356b41 |
+++ cracklib-2.9.0/util/cracklib-format 2013-10-31 15:24:01.976736045 +0100
|
|
|
356b41 |
@@ -3,8 +3,10 @@
|
|
|
356b41 |
# This preprocesses a set of word lists into a suitable form for input
|
|
|
356b41 |
# into cracklib-packer
|
|
|
356b41 |
#
|
|
|
356b41 |
+LC_ALL=C
|
|
|
356b41 |
+export LC_ALL
|
|
|
356b41 |
gzip -cdf "$@" |
|
|
|
356b41 |
grep -v '^\(#\|$\)' |
|
|
|
356b41 |
- tr '[A-Z]' '[a-z]' |
|
|
|
356b41 |
- tr -cd '\012[a-z][0-9]' |
|
|
|
356b41 |
+ tr '[:upper:]' '[:lower:]' |
|
|
|
356b41 |
+ tr -cd '\n[:graph:]' |
|
|
|
356b41 |
sort -u
|