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.
* named cdb_tests, cracklib_tests, and principal_tests.
*/
#include <tests/data/passwords/cdb.c>
* 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/cracklib.c>
#include <tests/data/passwords/length.c>
+#include <tests/data/passwords/letter.c>
#include <tests/data/passwords/principal.c>
#include <tests/data/passwords/principal.c>
*/
count = ARRAY_SIZE(cracklib_tests);
count += ARRAY_SIZE(cdb_tests);
*/
count = ARRAY_SIZE(cracklib_tests);
count += ARRAY_SIZE(cdb_tests);
- count += ARRAY_SIZE(class_tests);
count += ARRAY_SIZE(length_tests);
count += ARRAY_SIZE(length_tests);
+ count += ARRAY_SIZE(letter_tests);
count += ARRAY_SIZE(principal_tests) * 2;
plan(5 + count * 2);
count += ARRAY_SIZE(principal_tests) * 2;
plan(5 + count * 2);
for (i = 0; i < ARRAY_SIZE(principal_tests); i++)
is_password_test(verifier, &principal_tests[i]);
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";
setup_argv[5] = (char *) "require_ascii_printable";
setup_argv[6] = (char *) "true";
setup_argv[7] = (char *) "require_non_letter";
setup_argv[9] = NULL;
run_setup((const char **) setup_argv);
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
/*
* Add length restrictions and remove the dictionary. This should only do
* named cdb_tests, cracklib_tests, and principal_tests.
*/
#include <tests/data/passwords/cdb.c>
* 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/cracklib.c>
#include <tests/data/passwords/length.c>
+#include <tests/data/passwords/letter.c>
#include <tests/data/passwords/principal.c>
#include <tests/data/passwords/principal.c>
*/
count = 2 * ARRAY_SIZE(cracklib_tests);
count += ARRAY_SIZE(cdb_tests);
*/
count = 2 * ARRAY_SIZE(cracklib_tests);
count += ARRAY_SIZE(cdb_tests);
- count += ARRAY_SIZE(class_tests);
count += ARRAY_SIZE(length_tests);
count += ARRAY_SIZE(length_tests);
+ count += ARRAY_SIZE(letter_tests);
count += 2 * ARRAY_SIZE(principal_tests);
plan(2 + 5 + count * 2);
count += 2 * ARRAY_SIZE(principal_tests);
plan(2 + 5 + count * 2);
is_password_test(ctx, vtable, data, &cracklib_tests[i]);
vtable->close(ctx, data);
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";
setup_argv[5] = (char *) "require_ascii_printable";
setup_argv[6] = (char *) "true";
setup_argv[7] = (char *) "require_non_letter";
if (code != 0)
bail_krb5(ctx, code, "cannot initialize Kerberos context");
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);
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");
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);
/*
vtable->close(ctx, data);
/*
# Load the password tests from JSON. Accumulate a total count of tests for
# the testing plan.
my (%tests, $count);
# 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});
my $tests = load_password_tests("$type.json");
$tests{$type} = $tests;
$count += scalar(@{$tests});
-# 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',
$krb5_conf = create_krb5_conf(
{
require_ascii_printable => 'true',
local $ENV{KRB5_CONFIG} = $krb5_conf;
# Run the character class tests.
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} }) {