Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Auth/SASL.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,17 @@ public static function factory($type)

require_once($filename);
if (isset($parameter))
$obj = new $classname($parameter);
{
$obj = new $classname();
$check = $obj->factory($parameter);
if (PEAR::isError($check)) {
return $check;
}
}
else
{
$obj = new $classname();
}
return $obj;
}
}
Expand Down
16 changes: 14 additions & 2 deletions Auth/SASL/SCRAM.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,18 @@ class Auth_SASL_SCRAM extends Auth_SASL_Common
* format of core PHP hash function.
* @access public
*/
function __construct($hash)
function __construct()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are intentionally breaking the constructor signature for v2.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, i'm sorry @ashnazg. You're totally right. Sorry. I missed your comment. I will fix that soon. Thanks for your patience. :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToDo for @schengawegga: Leave parameter on constructor and call factory if parameter is set.

{
}

/**
* Construct a SCRAM-H client where 'H' is a cryptographic hash function.
*
* @param string $hash The name cryptographic hash function 'H' as registered by IANA in the "Hash Function Textual
* Names" registry.
* @return boolean|object true or PEAR::isError object
*/
public function factory($hash)
{
// Though I could be strict, I will actually also accept the naming used in the PHP core hash framework.
// For instance "sha1" is accepted, while the registered hash name should be "SHA-1".
Expand Down Expand Up @@ -109,7 +120,8 @@ function __construct($hash)
};
$this->hmac = array($this, '_HMAC_SHA1');
}
else {
else
{
return PEAR::raiseError('Invalid SASL mechanism type');
}

Expand Down