aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/passwords/driver
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/passwords/driver')
-rw-r--r--phpBB/phpbb/passwords/driver/base.php3
-rw-r--r--phpBB/phpbb/passwords/driver/driver_interface.php7
-rw-r--r--phpBB/phpbb/passwords/driver/helper.php5
-rw-r--r--phpBB/phpbb/passwords/driver/salted_md5.php8
4 files changed, 18 insertions, 5 deletions
diff --git a/phpBB/phpbb/passwords/driver/base.php b/phpBB/phpbb/passwords/driver/base.php
index b5414fccdc..f938bdd587 100644
--- a/phpBB/phpbb/passwords/driver/base.php
+++ b/phpBB/phpbb/passwords/driver/base.php
@@ -26,7 +26,8 @@ abstract class base implements driver_interface
/**
* Constructor of passwords driver object
*
- * @return string Hash prefix
+ * @param \phpbb\config\config $config phpBB config
+ * @param \phpbb\passwords\driver\helper $helper Password driver helper
*/
public function __construct(\phpbb\config\config $config, \phpbb\passwords\driver\helper $helper)
{
diff --git a/phpBB/phpbb/passwords/driver/driver_interface.php b/phpBB/phpbb/passwords/driver/driver_interface.php
index c4b57fd96e..53065dfb02 100644
--- a/phpBB/phpbb/passwords/driver/driver_interface.php
+++ b/phpBB/phpbb/passwords/driver/driver_interface.php
@@ -20,6 +20,7 @@ interface driver_interface
* @return bool True if supported, false if not
*/
public function is_supported();
+
/**
* Returns the hash prefix
*
@@ -30,7 +31,10 @@ interface driver_interface
/**
* Hash the password
*
- * @return string Password hash
+ * @param string $password The password that should be hashed
+ *
+ * @return bool|string Password hash or false if something went wrong
+ * during hashing
*/
public function hash($password);
@@ -39,6 +43,7 @@ interface driver_interface
*
* @param string $password The password to check
* @param string $hash The password hash to check against
+ *
* @return bool True if password is correct, else false
*/
public function check($password, $hash);
diff --git a/phpBB/phpbb/passwords/driver/helper.php b/phpBB/phpbb/passwords/driver/helper.php
index 77c8a87d06..4b8dc9a123 100644
--- a/phpBB/phpbb/passwords/driver/helper.php
+++ b/phpBB/phpbb/passwords/driver/helper.php
@@ -86,7 +86,8 @@ class helper
/**
* Return unique id
- * @param string $extra additional entropy
+ *
+ * @param string $extra Additional entropy
*
* @return string Unique id
*/
@@ -113,6 +114,8 @@ class helper
*
* @param int $length Salt length
* @param string $rand_seed Seed for random data (optional). For tests.
+ *
+ * @return string Random salt with specified length
*/
public function get_random_salt($length, $rand_seed = '/dev/urandom')
{
diff --git a/phpBB/phpbb/passwords/driver/salted_md5.php b/phpBB/phpbb/passwords/driver/salted_md5.php
index 72db8d200f..5c72726422 100644
--- a/phpBB/phpbb/passwords/driver/salted_md5.php
+++ b/phpBB/phpbb/passwords/driver/salted_md5.php
@@ -122,8 +122,11 @@ class salted_md5 extends base
/**
* Get hash settings
*
- * @return array Array containing the count_log2, salt, and full hash
- * settings string
+ * @param string $hash The hash that contains the settings
+ *
+ * @return bool|array Array containing the count_log2, salt, and full
+ * hash settings string or false if supplied hash is empty
+ * or contains incorrect settings
*/
public function get_hash_settings($hash)
{
@@ -131,6 +134,7 @@ class salted_md5 extends base
{
return false;
}
+
$count_log2 = strpos($this->helper->itoa64, $hash[3]);
$salt = substr($hash, 4, 8);