37Ensure (PBA, unique_hash_without_adding_used_pepper)
39 struct PBASettings setting = {
"4242", 20000,
"$6$"};
40 char *cmp_hash, *hash;
41 hash =
pba_hash (&setting,
"*password");
42 assert_not_equal (hash, NULL);
43 assert_false (string_contains (hash, setting.
pepper));
44 cmp_hash =
pba_hash (&setting,
"*password");
45 assert_string_not_equal (hash, cmp_hash);
90 assert_equal (settings->
count, 1);
92 assert_equal_with_message (settings->
pepper[i],
'4',
93 "init_with_pepper_should_be_set");
95 "last_pepper_should_be_unset_by_pepper_3");
96 assert_string_equal (settings->
prefix,
"$6$");
99 assert_equal_with_message (settings, NULL,
100 "should_fail_due_to_too_much_pepper");
102 assert_equal_with_message (settings, NULL,
103 "should_fail_due_to_unknown_prefix");
123 suite = create_test_suite ();
125 add_test_with_context (suite, PBA,
126 returns_false_on_not_phc_compliant_setting);
127 add_test_with_context (suite, PBA, returns_true_on_phc_compliant_setting);
128 add_test_with_context (suite, PBA, returns_NULL_on_unsupport_settings);
129 add_test_with_context (suite, PBA, unique_hash_without_adding_used_pepper);
130 add_test_with_context (suite, PBA, verify_hash);
131 add_test_with_context (suite, PBA,
132 verify_hash_returns_invalid_on_np_hash_np_password);
133 add_test_with_context (suite, PBA, handle_md5_hash);
134 add_test_with_context (suite, PBA, defaults);
135 add_test_with_context (suite, PBA, initialization);
138 ret = run_single_test (suite, argv[1], create_text_reporter ());
140 ret = run_test_suite (suite, create_text_reporter ());
142 destroy_test_suite (suite);