Skip to content

Commit d6b6ca5

Browse files
authored
Merge pull request hestiacp#2397 from jaapmarcus/fix/block-yesscrypt-attempts-valid
Add warning if user tries to login with yesscrypt hashed password
2 parents 4fdece7 + d7a3357 commit d6b6ca5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bin/v-check-user-password

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ if echo "$shadow" | grep -qE '^\$[0-9a-z]+\$[^\$]+\$'
6262
then
6363
salt=$(echo "$shadow" |cut -f 3 -d \$)
6464
method=$(echo "$shadow" |cut -f 2 -d \$)
65-
if [ "$method" -eq '1' ]; then
65+
if [ "$method" = "y" ]; then
66+
echo "Unsuported hash method";
67+
exit 1;
68+
elif [ "$method" -eq '1' ]; then
6669
method='md5'
6770
elif [ "$method" -eq '6' ]; then
6871
method='sha-512'

web/login/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ function authenticate_user($user, $password, $twofa = '')
107107
sleep(2);
108108
if($return_var == 5){
109109
$error = '<a class="error">' . _('Account has been suspended') . '</a>';
110+
}elseif($return_var == 1){
111+
$error = '<a class="error">' . _('Unsuported hash method') . '</a>';
110112
}else{
111113
$error = '<a class="error">' . _('Invalid username or password') . '</a>';
112114
}

0 commit comments

Comments
 (0)