Check smd5 password fix (#222)

Closes #221
This commit is contained in:
Eugene Suprun 2023-08-30 03:12:45 +03:00 committed by GitHub
parent 226a76d5fc
commit 4c215e8592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2425,7 +2425,7 @@ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword
case 'smd5': case 'smd5':
$hash = base64_decode($cryptedpassword); $hash = base64_decode($cryptedpassword);
$salt = substr($hash,16); $salt = substr($hash,16);
$new_hash = base64_encode(md5($plainpassword.$salt).$salt, true); $new_hash = base64_encode(md5($plainpassword.$salt, true).$salt);
if (strcmp($cryptedpassword,$new_hash) == 0) if (strcmp($cryptedpassword,$new_hash) == 0)
return true; return true;