]> eyrie.org Git - kerberos/krb5-strength.git/blob - debian/patches/0001-Change-CrackLib-tests-for-system-CrackLib.patch
Change CrackLib tests for system CrackLib
[kerberos/krb5-strength.git] / debian / patches / 0001-Change-CrackLib-tests-for-system-CrackLib.patch
1 From: Russ Allbery <eagle@eyrie.org>
2 Date: Sun, 25 Dec 2016 11:50:14 -0800
3 Subject: Change CrackLib tests for system CrackLib
4
5 The upstream test suite contains a few tests that fail with the
6 normal system CrackLib rules.  Modify them to expect passes so
7 that we can run the full test suite during the build.
8
9 Also remove CrackLib when testing character classes, since it
10 rejects the passwords used for minimum_different testing as too
11 simplistic.
12 ---
13  tests/data/passwords/cracklib.json |  8 ++------
14  tests/plugin/mit-t.c               | 12 ++++++------
15  2 files changed, 8 insertions(+), 12 deletions(-)
16
17 diff --git a/tests/data/passwords/cracklib.json b/tests/data/passwords/cracklib.json
18 index 037a70f..b69e700 100644
19 --- a/tests/data/passwords/cracklib.json
20 +++ b/tests/data/passwords/cracklib.json
21 @@ -22,9 +22,7 @@
22      {
23          "name": "in dictionary (repeated)",
24          "principal": "test@EXAMPLE.ORG",
25 -        "password": "stanfordstanford",
26 -        "code": "KADM5_PASS_Q_GENERIC",
27 -        "error": "it is based on a (duplicated) dictionary word"
28 +        "password": "stanfordstanford"
29      },
30      {
31          "name": "in dictionary (reversed)",
32 @@ -36,9 +34,7 @@
33      {
34          "name": "seven characters",
35          "principal": "test@EXAMPLE.ORG",
36 -        "password": "dfareas",
37 -        "code": "KADM5_PASS_Q_GENERIC",
38 -        "error": "it is too short"
39 +        "password": "dfareas"
40      },
41      {
42          "name": "four characters",
43 diff --git a/tests/plugin/mit-t.c b/tests/plugin/mit-t.c
44 index 7eba594..4406e38 100644
45 --- a/tests/plugin/mit-t.c
46 +++ b/tests/plugin/mit-t.c
47 @@ -272,13 +272,13 @@ main(void)
48      vtable->close(ctx, data);
49  
50      /* Add simple character class configuration to krb5.conf. */
51 -    setup_argv[5] = (char *) "minimum_different";
52 -    setup_argv[6] = (char *) "8";
53 -    setup_argv[7] = (char *) "require_ascii_printable";
54 +    setup_argv[3] = (char *) "minimum_different";
55 +    setup_argv[4] = (char *) "8";
56 +    setup_argv[5] = (char *) "require_ascii_printable";
57 +    setup_argv[6] = (char *) "true";
58 +    setup_argv[7] = (char *) "require_non_letter";
59      setup_argv[8] = (char *) "true";
60 -    setup_argv[9] = (char *) "require_non_letter";
61 -    setup_argv[10] = (char *) "true";
62 -    setup_argv[11] = NULL;
63 +    setup_argv[9] = NULL;
64      run_setup((const char **) setup_argv);
65  
66      /* Obtain a new Kerberos context with that krb5.conf file. */