SF Bug #2997552 - Unable to verify password using SMD5 scheme
This commit is contained in:
parent
ed7f899361
commit
aa8a353c38
@ -2237,7 +2237,7 @@ function password_check($cryptedpassword,$plainpassword) {
|
|||||||
# Check php mhash support before using it
|
# Check php mhash support before using it
|
||||||
if (function_exists('mhash')) {
|
if (function_exists('mhash')) {
|
||||||
$hash = base64_decode($cryptedpassword);
|
$hash = base64_decode($cryptedpassword);
|
||||||
$salt = substr($hash,-4);
|
$salt = substr($hash,16);
|
||||||
$new_hash = base64_encode(mhash(MHASH_MD5,$plainpassword.$salt).$salt);
|
$new_hash = base64_encode(mhash(MHASH_MD5,$plainpassword.$salt).$salt);
|
||||||
|
|
||||||
if (strcmp($cryptedpassword,$new_hash) == 0)
|
if (strcmp($cryptedpassword,$new_hash) == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user