SF Bug #2997552 - Unable to verify password using SMD5 scheme

This commit is contained in:
Deon George 2011-04-26 11:27:32 +10:00
parent ed7f899361
commit aa8a353c38

View File

@ -2237,7 +2237,7 @@ function password_check($cryptedpassword,$plainpassword) {
# Check php mhash support before using it
if (function_exists('mhash')) {
$hash = base64_decode($cryptedpassword);
$salt = substr($hash,-4);
$salt = substr($hash,16);
$new_hash = base64_encode(mhash(MHASH_MD5,$plainpassword.$salt).$salt);
if (strcmp($cryptedpassword,$new_hash) == 0)