|
|
@@ -24,6 +24,9 @@
|
|
|
*/
|
|
|
require_once 'Zend/Ldap/Converter.php';
|
|
|
|
|
|
+/** @see Zend_Crypt_Math */
|
|
|
+require_once 'Zend/Crypt/Math.php';
|
|
|
+
|
|
|
/**
|
|
|
* Zend_Ldap_Attribute is a collection of LDAP attribute related functions.
|
|
|
*
|
|
|
@@ -311,7 +314,7 @@ class Zend_Ldap_Attribute
|
|
|
}
|
|
|
return $password;
|
|
|
case self::PASSWORD_HASH_SSHA:
|
|
|
- $salt = substr(sha1(uniqid(mt_rand(), true), true), 0, 4);
|
|
|
+ $salt = Zend_Crypt_Math::randBytes(4);
|
|
|
$rawHash = sha1($password . $salt, true) . $salt;
|
|
|
$method = '{SSHA}';
|
|
|
break;
|
|
|
@@ -320,7 +323,7 @@ class Zend_Ldap_Attribute
|
|
|
$method = '{SHA}';
|
|
|
break;
|
|
|
case self::PASSWORD_HASH_SMD5:
|
|
|
- $salt = substr(sha1(uniqid(mt_rand(), true), true), 0, 4);
|
|
|
+ $salt = Zend_Crypt_Math::randBytes(4);
|
|
|
$rawHash = md5($password . $salt, true) . $salt;
|
|
|
$method = '{SMD5}';
|
|
|
break;
|