]> eyrie.org Git - kerberos/krb5-strength.git/commitdiff
Rename the class test set to letter
authorRuss Allbery <eagle@eyrie.org>
Thu, 12 Dec 2013 06:01:49 +0000 (22:01 -0800)
committerRuss Allbery <eagle@eyrie.org>
Thu, 12 Dec 2013 06:01:49 +0000 (22:01 -0800)
Next is to add support for full character class rules, which will
reuse a similar name, so move the simplistic character class rules
to the name letter.json.

tests/data/passwords/letter.json [moved from tests/data/passwords/class.json with 100% similarity]
tests/plugin/heimdal-t.c
tests/plugin/mit-t.c
tests/tools/heimdal-strength-t

index 903fed965370ab2ba6ff64badbc5f44498d178db..95deac9aeb4ffe36c1d0c946f1cac746e27b7f53 100644 (file)
@@ -29,9 +29,9 @@
  * named cdb_tests, cracklib_tests, and principal_tests.
  */
 #include <tests/data/passwords/cdb.c>
-#include <tests/data/passwords/class.c>
 #include <tests/data/passwords/cracklib.c>
 #include <tests/data/passwords/length.c>
+#include <tests/data/passwords/letter.c>
 #include <tests/data/passwords/principal.c>
 
 
@@ -148,8 +148,8 @@ main(void)
      */
     count = ARRAY_SIZE(cracklib_tests);
     count += ARRAY_SIZE(cdb_tests);
-    count += ARRAY_SIZE(class_tests);
     count += ARRAY_SIZE(length_tests);
+    count += ARRAY_SIZE(letter_tests);
     count += ARRAY_SIZE(principal_tests) * 2;
     plan(5 + count * 2);
 
@@ -186,7 +186,7 @@ main(void)
     for (i = 0; i < ARRAY_SIZE(principal_tests); i++)
         is_password_test(verifier, &principal_tests[i]);
 
-    /* Add character class restrictions. */
+    /* Add simple character class restrictions. */
     setup_argv[5] = (char *) "require_ascii_printable";
     setup_argv[6] = (char *) "true";
     setup_argv[7] = (char *) "require_non_letter";
@@ -194,9 +194,9 @@ main(void)
     setup_argv[9] = NULL;
     run_setup((const char **) setup_argv);
 
-    /* Run the character class tests. */
-    for (i = 0; i < ARRAY_SIZE(class_tests); i++)
-        is_password_test(verifier, &class_tests[i]);
+    /* Run the simple character class tests. */
+    for (i = 0; i < ARRAY_SIZE(letter_tests); i++)
+        is_password_test(verifier, &letter_tests[i]);
 
     /*
      * Add length restrictions and remove the dictionary.  This should only do
index 3f96284fafaf1e4cf44db1cb6b17bbbce1a53b9c..7e5a268a71b3533430c1b9e290ef11aa566650ef 100644 (file)
@@ -30,9 +30,9 @@
  * named cdb_tests, cracklib_tests, and principal_tests.
  */
 #include <tests/data/passwords/cdb.c>
-#include <tests/data/passwords/class.c>
 #include <tests/data/passwords/cracklib.c>
 #include <tests/data/passwords/length.c>
+#include <tests/data/passwords/letter.c>
 #include <tests/data/passwords/principal.c>
 
 
@@ -166,8 +166,8 @@ main(void)
      */
     count = 2 * ARRAY_SIZE(cracklib_tests);
     count += ARRAY_SIZE(cdb_tests);
-    count += ARRAY_SIZE(class_tests);
     count += ARRAY_SIZE(length_tests);
+    count += ARRAY_SIZE(letter_tests);
     count += 2 * ARRAY_SIZE(principal_tests);
     plan(2 + 5 + count * 2);
 
@@ -239,7 +239,7 @@ main(void)
         is_password_test(ctx, vtable, data, &cracklib_tests[i]);
     vtable->close(ctx, data);
 
-    /* Add character class configuration to krb5.conf. */
+    /* Add simple character class configuration to krb5.conf. */
     setup_argv[5] = (char *) "require_ascii_printable";
     setup_argv[6] = (char *) "true";
     setup_argv[7] = (char *) "require_non_letter";
@@ -253,13 +253,13 @@ main(void)
     if (code != 0)
         bail_krb5(ctx, code, "cannot initialize Kerberos context");
 
-    /* Run all the character class tests. */
+    /* Run all the simple character class tests. */
     code = vtable->open(ctx, NULL, &data);
-    is_int(0, code, "Plugin initialization (character class)");
+    is_int(0, code, "Plugin initialization (simple character class)");
     if (code != 0)
         bail("cannot continue after plugin initialization failure");
-    for (i = 0; i < ARRAY_SIZE(class_tests); i++)
-        is_password_test(ctx, vtable, data, &class_tests[i]);
+    for (i = 0; i < ARRAY_SIZE(letter_tests); i++)
+        is_password_test(ctx, vtable, data, &letter_tests[i]);
     vtable->close(ctx, data);
 
     /*
index 9c2d1635da53689a38823080bc276b015d1a7cfe..918b884e0bbbf070af7d1f52634d6cbdae895597 100755 (executable)
@@ -149,7 +149,7 @@ sub load_password_tests {
 # Load the password tests from JSON.  Accumulate a total count of tests for
 # the testing plan.
 my (%tests, $count);
-for my $type (qw(cdb class cracklib length principal)) {
+for my $type (qw(cdb cracklib length letter principal)) {
     my $tests = load_password_tests("$type.json");
     $tests{$type} = $tests;
     $count += scalar(@{$tests});
@@ -188,7 +188,7 @@ for my $test (@{ $tests{length} }) {
     check_password($test);
 }
 
-# Install the krb5.conf file for character class restrictions.
+# Install the krb5.conf file for simple character class restrictions.
 $krb5_conf = create_krb5_conf(
     {
         require_ascii_printable => 'true',
@@ -198,8 +198,8 @@ $krb5_conf = create_krb5_conf(
 local $ENV{KRB5_CONFIG} = $krb5_conf;
 
 # Run the character class tests.
-note('Password character class checks');
-for my $test (@{ $tests{class} }) {
+note('Simple password character class checks');
+for my $test (@{ $tests{letter} }) {
     check_password($test);
 }