TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Saltedpasswords\Salt\SaltFactory Class Reference

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

Class that implements Blowfish salted hashing based on PHP's crypt() function.

Definition at line 21 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
bool 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 61 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 37 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 82 of file SaltFactory.php.

References 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\Setup\Controller\SetupModuleController\getFormProtection(), TYPO3\CMS\Install\Controller\Action\AbstractAction\getHashedPassword(), TYPO3\CMS\Install\Report\SecurityStatusReport\getInstallToolPasswordStatus(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getRecordRegistrationStatus(), 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. ::class)
Returns
An instance of salting hashing method object

Definition at line 141 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 29 of file SaltFactory.php.