Skip to content

Commit

Permalink
Merge pull request #8348 from mbabker/deprecate-JCryptPassword
Browse files Browse the repository at this point in the history
Deprecate JCryptPassword
  • Loading branch information
wilsonge committed Nov 9, 2015
2 parents 1529d8f + edda85b commit fee261c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion libraries/joomla/crypt/password.php
Expand Up @@ -12,7 +12,8 @@
/**
* Joomla Platform Password Hashing Interface
*
* @since 12.2
* @since 12.2
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
interface JCryptPassword
{
Expand All @@ -33,6 +34,7 @@ interface JCryptPassword
* @return string The hashed password.
*
* @since 12.2
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function create($password, $type = null);

Expand All @@ -45,6 +47,7 @@ public function create($password, $type = null);
* @return boolean True if the password is valid, false otherwise.
*
* @since 12.2
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function verify($password, $hash);

Expand All @@ -56,6 +59,7 @@ public function verify($password, $hash);
* @return void
*
* @since 12.3
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function setDefaultType($type);

Expand All @@ -65,6 +69,7 @@ public function setDefaultType($type);
* @return void
*
* @since 12.3
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function getDefaultType();
}
11 changes: 10 additions & 1 deletion libraries/joomla/crypt/password/simple.php
Expand Up @@ -12,19 +12,22 @@
/**
* Joomla Platform Password Crypter
*
* @since 12.2
* @since 12.2
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
class JCryptPasswordSimple implements JCryptPassword
{
/**
* @var integer The cost parameter for hashing algorithms.
* @since 12.2
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
protected $cost = 10;

/**
* @var string The default hash type
* @since 12.3
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
protected $defaultType = '$2y$';

Expand All @@ -38,6 +41,7 @@ class JCryptPasswordSimple implements JCryptPassword
*
* @since 12.2
* @throws InvalidArgumentException
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function create($password, $type = null)
{
Expand Down Expand Up @@ -88,6 +92,7 @@ public function create($password, $type = null)
* @return void
*
* @since 12.2
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function setCost($cost)
{
Expand All @@ -102,6 +107,7 @@ public function setCost($cost)
* @return string The string of random characters.
*
* @since 12.2
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
protected function getSalt($length)
{
Expand All @@ -121,6 +127,7 @@ protected function getSalt($length)
* @return boolean True if the password is valid, false otherwise.
*
* @since 12.2
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function verify($password, $hash)
{
Expand Down Expand Up @@ -162,6 +169,7 @@ public function verify($password, $hash)
* @return void
*
* @since 12.3
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function setDefaultType($type)
{
Expand All @@ -177,6 +185,7 @@ public function setDefaultType($type)
* @return string $type The default type
*
* @since 12.3
* @deprecated 4.0 Use PHP 5.5's native password hashing API
*/
public function getDefaultType()
{
Expand Down

0 comments on commit fee261c

Please sign in to comment.