Skip to content

Commit c3dda58

Browse files
committed
Add support for yesscrypt
1 parent 242df31 commit c3dda58

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

web/api/index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ function api_legacy(array $request_data) {
8484
$hash = crypt($password, '$6$rounds=5000$'.$salt.'$');
8585
$hash = str_replace('$rounds=5000', '', $hash);
8686
}
87+
if ($method == 'yescrypt') {
88+
$v_password = tempnam("/tmp", "vst");
89+
$fp = fopen($v_password, "w");
90+
fwrite($fp, $password."\n");
91+
fclose($fp);
92+
exec(HESTIA_CMD . 'v-check-user-password '. $v_user.' '. $v_password. ' '.$v_ip.' yes', $output, $return_var);
93+
$hash = $output[0];
94+
unset($output);
95+
}
8796
if ($method == 'des') {
8897
$hash = crypt($password, $salt);
8998
}

0 commit comments

Comments
 (0)