Permalink
Browse files

Fixing coding conventions and updating copyrights.

  • Loading branch information...
1 parent ba8f337 commit 901a9e45a7738e3afe8cc5711052181345bd38eb @nateabele nateabele committed Jun 3, 2011
@@ -51,7 +51,7 @@ class Auth extends \lithium\core\Adaptable {
* @var array Associative array of class names & their namespaces.
*/
protected static $_classes = array(
- 'session' => '\lithium\storage\Session'
+ 'session' => 'lithium\storage\Session'
);
/**
@@ -1,11 +1,10 @@
<?php
/**
- * Lithium: the most rad php framework
- *
- * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
- * Copyright 2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @license http://opensource.org/licenses/mit-license.php The MIT License
- */
+* Lithium: the most rad php framework
+*
+* @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)
+* @license http://opensource.org/licenses/bsd-license.php The BSD License
+*/
namespace lithium\security;
@@ -114,9 +113,9 @@ protected static function _source() {
* Uses PHP's hashing functions to create a hash of the string provided, using the options
* specified. The default hash algorithm is SHA-512.
*
- * @link http://php.net/manual/en/function.hash.php PHP Manual: hash()
- * @link http://php.net/manual/en/function.hash-hmac.php PHP Manual: hash_hmac()
- * @link http://php.net/manual/en/function.hash-algos.php PHP Manual: hash_algos()
+ * @link http://php.net/manual/en/function.hash.php PHP Manual: `hash()`
+ * @link http://php.net/manual/en/function.hash-hmac.php PHP Manual: `hash_hmac()`
+ * @link http://php.net/manual/en/function.hash-algos.php PHP Manual: `hash_algos()`
* @param string $string The string to hash.
* @param array $options Supported options:
* - `'type'` _string_: Any valid hashing algorithm. See the `hash_algos()` function to
@@ -2,22 +2,22 @@
/**
* Lithium: the most rad php framework
*
- * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
- * Copyright 2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @license http://opensource.org/licenses/mit-license.php The MIT License
+ * @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)
+ * @license http://opensource.org/licenses/bsd-license.php The BSD License
*/
namespace lithium\security;
-use \lithium\security\Crypto;
-use \lithium\storage\Session;
+use lithium\security\Crypto;
+use lithium\storage\Session;
/**
* Password utility class that makes use of PHP's `crypt()` function. Includes a
* cryptographically strong salt generator, and utility functions to hash and check
* passwords.
*/
class Nonce {
+
protected static $_salt;
/**
@@ -27,7 +27,7 @@ class Nonce {
* @param mixed $id Optional. The integer id or string key that identifies the
* data to which the action is applied.
* @return void
- **/
+ */
public static function create($action, $id = null) {
$salt = static::$_salt ?: static::_salt();
return hash_hmac('sha256', "$action$id", $salt);
@@ -2,14 +2,13 @@
/**
* Lithium: the most rad php framework
*
- * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
- * Copyright 2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @license http://opensource.org/licenses/mit-license.php The MIT License
+ * @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)
+ * @license http://opensource.org/licenses/bsd-license.php The BSD License
*/
namespace lithium\security;
-use \lithium\security\Crypto;
+use lithium\security\Crypto;
/**
* Password utility class that makes use of PHP's `crypt()` function. Includes a
@@ -2,7 +2,7 @@
/**
* Lithium: the most rad php framework
*
-* @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
+* @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)
* @license http://opensource.org/licenses/bsd-license.php The BSD License
*/
@@ -2,13 +2,13 @@
/**
* Lithium: the most rad php framework
*
- * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
+ * @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)
* @license http://opensource.org/licenses/bsd-license.php The BSD License
*/
namespace lithium\tests\cases\security;
-use \lithium\security\Crypto;
+use lithium\security\Crypto;
class CryptoTest extends \lithium\test\Unit {
/**
@@ -2,20 +2,19 @@
/**
* Lithium: the most rad php framework
*
- * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
+ * @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)
* @license http://opensource.org/licenses/bsd-license.php The BSD License
*/
namespace lithium\tests\cases\security;
-use \lithium\security\Password;
+use lithium\security\Password;
class PasswordTest extends \lithium\test\Unit {
+
/**
* testPassword method
- *
- * @return void
- **/
+ */
public function testPassword() {
$pass = 'Lithium rocks!';
@@ -52,15 +51,15 @@ public function testPassword() {
}
}
}
-
+
/**
* testPasswordMaxLength method
*
* @return void
- **/
+ */
public function testPasswordMaxLength() {
foreach (array('bf' => 72) as $method => $length) {
- $salt = Password::genSalt($method);
+ $salt = Password::salt($method);
$pass = str_repeat('a', $length);
$this->assertIdentical(Password::hash($pass, $salt), Password::hash($pass . 'a', $salt));
}

0 comments on commit 901a9e4

Please sign in to comment.