diff --git a/tests/usr.bin/argon2/t_argon2.sh b/tests/usr.bin/argon2/t_argon2.sh index d6e624b8db70..ae29d77e071b 100644 --- a/tests/usr.bin/argon2/t_argon2.sh +++ b/tests/usr.bin/argon2/t_argon2.sh @@ -58,6 +58,59 @@ argon2_argon2d_k2096_p2_t4_body() { 'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 2 -t 4' } +atf_test_case argon2_argon2id_k2096_p1_v10 +argon2_argon2id_k2096_p1_v10_head() { + atf_set "descr" "ATF test for argon2 argon2id,k=2096,p=1,v=10" +} +argon2_argon2id_k2096_p1_v10_body() { + atf_check -s exit:0 -o match:"^\\\$argon2id\\\$v=16\\\$m=2096,t=3,p=1" -x \ + 'echo -n 'password' | argon2 somesalt -e -id -k 2096 -p 1 -v 10' +} + +atf_test_case argon2_argon2id_k2096_p1_v13 +argon2_argon2id_k2096_p1_v13_head() { + atf_set "descr" "ATF test for argon2 argon2id,k=2096,p=1,v=13" +} +argon2_argon2id_k2096_p1_v13_body() { + atf_check -s exit:0 -o match:"^\\\$argon2id\\\$v=19\\\$m=2096,t=3,p=1" -x \ + 'echo -n 'password' | argon2 somesalt -e -id -k 2096 -p 1 -v 13' +} + +atf_test_case argon2_argon2i_k2096_p1_v10 +argon2_argon2i_k2096_p1_v10_head() { + atf_set "descr" "ATF test for argon2 argon2i,k=2096,p=1,v=10" +} +argon2_argon2i_k2096_p1_v10_body() { + atf_check -s exit:0 -o match:"^\\\$argon2i\\\$v=16\\\$m=2096,t=3,p=1" -x \ + 'echo -n 'password' | argon2 somesalt -e -i -k 2096 -p 1 -v 10' +} + +atf_test_case argon2_argon2i_k2096_p1_v13 +argon2_argon2i_k2096_p1_v13_head() { + atf_set "descr" "ATF test for argon2 argon2i,k=2096,p=1,v=13" +} +argon2_argon2i_k2096_p1_v13_body() { + atf_check -s exit:0 -o match:"^\\\$argon2i\\\$v=19\\\$m=2096,t=3,p=1" -x \ + 'echo -n 'password' | argon2 somesalt -e -i -k 2096 -p 1 -v 13' +} + +atf_test_case argon2_argon2d_k2096_p1_v10 +argon2_argon2d_k2096_p1_v10_head() { + atf_set "descr" "ATF test for argon2 argon2d,k=2096,p=1,v=10" +} +argon2_argon2d_k2096_p1_v10_body() { + atf_check -s exit:0 -o match:"^\\\$argon2d\\\$v=16\\\$m=2096,t=3,p=1" -x \ + 'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 1 -v 10' +} + +atf_test_case argon2_argon2d_k2096_p1_v13 +argon2_argon2d_k2096_p1_v13_head() { + atf_set "descr" "ATF test for argon2 argon2d,k=2096,p=1,v=13" +} +argon2_argon2d_k2096_p1_v13_body() { + atf_check -s exit:0 -o match:"^\\\$argon2d\\\$v=19\\\$m=2096,t=3,p=1" -x \ + 'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 1 -v 13' +} atf_init_test_cases() { @@ -67,4 +120,10 @@ atf_init_test_cases() atf_add_test_case argon2_argon2id_k2096_p2_t3 atf_add_test_case argon2_argon2i_k2096_p1_t4 atf_add_test_case argon2_argon2d_k2096_p2_t4 + atf_add_test_case argon2_argon2id_k2096_p1_v10 + atf_add_test_case argon2_argon2id_k2096_p1_v13 + atf_add_test_case argon2_argon2i_k2096_p1_v10 + atf_add_test_case argon2_argon2i_k2096_p1_v13 + atf_add_test_case argon2_argon2d_k2096_p1_v10 + atf_add_test_case argon2_argon2d_k2096_p1_v13 }