From 2174d8a02c29f20002db0cfecbadadd2923a469a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 8 Jun 2008 13:07:25 +0000 Subject: [PATCH] Salt length reduced --- inc/classes/main/rng/class_RandomNumberGenerator.php | 8 ++++---- inc/config.php | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index 5856b9e..a8063c6 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -38,9 +38,9 @@ class RandomNumberGenerator extends BaseFrameworkSystem { private $extraSalt = ""; /** - * Maximum length for salt + * Maximum length for random string */ - private $saltLength = 0; + private $rndStrLen = 0; /** * Private constructor @@ -97,7 +97,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { $this->extraSalt = sha1(getenv('SERVER_ADDR') . ":" . getenv('SERVER_SOFTWARE') . ":" . $this->getConfigInstance()->readConfig('date_key') . ":" . serialize($this->getDatabaseInstance()->getConnectionData())); // Get config entry for max salt length - $this->saltLength = $this->getConfigInstance()->readConfig('salt_length'); + $this->rndStrLen = $this->getConfigInstance()->readConfig('rnd_str_length'); } /** @@ -108,7 +108,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { */ public function makeRandomString ($length = -1) { // Is the number <1, then fix it to default length - if ($length < 1) $length = $this->saltLength; + if ($length < 1) $length = $this->rndStrLen; // Initialize the string $randomString = ""; diff --git a/inc/config.php b/inc/config.php index 879c84d..eabfde1 100644 --- a/inc/config.php +++ b/inc/config.php @@ -190,7 +190,10 @@ $cfg->setConfigEntry('math_prime', 591623); $cfg->setConfigEntry('date_key', date("d-m-Y (l-F-T)", time())); // CFG: SALT-LENGTH -$cfg->setConfigEntry('salt_length', 128); +$cfg->setConfigEntry('salt_length', 10); + +// CFG: RND-STR-LENGTH +$cfg->setConfigEntry('rnd_str_length', 128); // [EOF] ?> -- 2.39.5