pam - test password hashes added yescrypt
@@ -12,10 +12,13 @@ source "${thisDir}/helpers"
check_rootdir "${rootfsDir}" || exit 1
-if grep -qP '^password\s+\[\s?success=1\s+default=ignore\s?]\s+pam_unix\.so\s+obscure\s+use_authtok\s+try_first_pass\s+sha512\s?$' "${rootfsDir}/etc/pam.d/common-password"; then
- echo "OK - password hashes as expected"
+if grep -qP '^password\s+\[\s?success=1\s+default=ignore\]\s+pam_unix.so\s+obscure\s+sha512\s?$' "${rootfsDir}/etc/pam.d/common-password"; then
+ echo "OK - password hashes as expected - sha512"
+ exit 0
+elif grep -qP '^password\s+\[\s?success=1\s+default=ignore\]\s+pam_unix.so\s+obscure\s+use_authtok\s+try_first_pass\s+yescrypt\s?$' "${rootfsDir}/etc/pam.d/common-password"; then
+ echo "OK - password hashes as expected - yesscrypt"
exit 0
else
- echo "FAIL - password hashes do not default to sha512"
+ echo "FAIL - password hashes do not default to sha512 or yesscrypt"
exit 1
fi
