TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Saltedpasswords\Salt\SaltFactory Class Reference
Inheritance diagram for TYPO3\CMS\Saltedpasswords\Salt\SaltFactory:
tx_saltedpasswords_salts_factory

Static Public Member Functions

static getRegisteredSaltedHashingMethods ()
 
static getSaltingInstance ($saltedHash='', $mode=TYPO3_MODE)
 
static determineSaltingHashingMethod ($saltedHash, $mode=TYPO3_MODE)
 
static setPreferredHashingMethod ($resource)
 

Static Protected Member Functions

static getDefaultSaltMethods ()
 

Static Protected Attributes

static $instance = NULL
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Class that implements Blowfish salted hashing based on PHP's crypt() function.

Author
Marcus Krause <marcus::exp2009.info>

Definition at line 23 of file SaltFactory.php.

Member Function Documentation

◆ determineSaltingHashingMethod()

static TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::determineSaltingHashingMethod (   $saltedHash,
  $mode = TYPO3_MODE 
)
static

Method tries to determine the salting hashing method used for given salt.

Method implicitly sets the instance of the found method object in the class property when found.

Parameters
string$saltedHash
string$mode(optional) The TYPO3 mode (FE or BE) saltedpasswords shall be used for
Returns
boolean TRUE, if salting hashing method has been found, otherwise FALSE

Definition at line 113 of file SaltFactory.php.

References TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility\getDefaultSaltingHashingMethod(), and TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj().

Referenced by TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\isSaltedHash().

◆ getDefaultSaltMethods()

static TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getDefaultSaltMethods ( )
staticprotected

Returns an array with default salt method class names.

Returns
array

Definition at line 62 of file SaltFactory.php.

◆ getRegisteredSaltedHashingMethods()

static TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getRegisteredSaltedHashingMethods ( )
static

Returns list of all registered hashing methods. Used eg. in extension configuration to select the default hashing method.

Returns
array

Definition at line 39 of file SaltFactory.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Saltedpasswords\Utility\ExtensionManagerConfigurationUtility\buildHashMethodSelector().

◆ getSaltingInstance()

static TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance (   $saltedHash = '',
  $mode = TYPO3_MODE 
)
static

Obtains a salting hashing method instance.

This function will return an instance of a class that implements

Use parameter NULL to reset the factory!

Parameters
string | NULL$saltedHashSalted hashed password to determine the type of used method from or NULL to reset to the default type
string$modeThe TYPO3 mode (FE or BE) saltedpasswords shall be used for
Returns
SaltInterface An instance of salting hash method class

Definition at line 83 of file SaltFactory.php.

References $result, TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility\getDefaultSaltingHashingMethod(), and TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj().

Referenced by TYPO3\CMS\Saltedpasswords\Utility\ExtensionManagerConfigurationUtility\checkConfigurationBackend(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\checkSchedulerUser(), TYPO3\CMS\Install\Controller\AbstractController\checkSessionLifetime(), TYPO3\CMS\Saltedpasswords\SaltedPasswordService\compareUident(), TYPO3\CMS\Saltedpasswords\Task\BulkUpdateTask\convertPasswords(), TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility\feloginForgotPasswordHook(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getCacheFloodingProtectionStatus(), TYPO3\CMS\Install\Controller\Action\AbstractAction\getHashedPassword(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getInstallToolPasswordStatus(), TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt\SaltFactoryTest\objectInstanceForBlowfishSalts(), TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt\SaltFactoryTest\objectInstanceForMD5Salts(), TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt\SaltFactoryTest\objectInstanceForPhpassSalts(), TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt\SaltFactoryTest\resettingFactoryInstanceSucceeds(), TYPO3\CMS\Saltedpasswords\Evaluation\Evaluator\returnFieldJS(), and TYPO3\CMS\Saltedpasswords\Tests\Unit\Salt\SaltFactoryTest\setUp().

◆ setPreferredHashingMethod()

static TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::setPreferredHashingMethod (   $resource)
static

Method sets a custom salting hashing method class.

Parameters
string$resourceObject resource to use (e.g. 'TYPO3\CMS\Saltedpasswords\Salt\BlowfishSalt')
Returns
An instance of salting hashing method object

Definition at line 140 of file SaltFactory.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj().

Member Data Documentation

◆ $instance

TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::$instance = NULL
staticprotected

Definition at line 31 of file SaltFactory.php.