TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
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

static 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 114 of file SaltFactory.php.

References SaltedPasswordsUtility\getDefaultSaltingHashingMethod(), and GeneralUtility\getUserObj().

Referenced by BulkUpdateTask\isSaltedHash().

static getDefaultSaltMethods ( )
staticprotected

Returns an array with default salt method class names.

Returns
array

Definition at line 61 of file SaltFactory.php.

static 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 ExtensionManagerConfigurationUtility\buildHashMethodSelector().

static 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 SaltedPasswordsUtility\getDefaultSaltingHashingMethod(), and GeneralUtility\getUserObj().

Referenced by ExtensionManagerConfigurationUtility\checkConfigurationBackend(), SaltedPasswordService\compareUident(), SaltedPasswordsUtility\feloginForgotPasswordHook(), AbstractAction\getHashedPassword(), AcceptanceCoreEnvironment\getInstallToolPassword(), SecurityStatusReport\getInstallToolPasswordStatus(), SaltFactoryTest\objectInstanceForBlowfishSalts(), SaltFactoryTest\objectInstanceForMD5Salts(), SaltFactoryTest\objectInstanceForPbkdf2Salts(), SaltFactoryTest\objectInstanceForPhpassSalts(), SaltFactoryTest\resettingFactoryInstanceSucceeds(), SaltFactoryTest\setUp(), and BulkUpdateTaskTest\testIfPasswordsAreUpdatedWithSaltedHashesForGivenUserList().

static 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 142 of file SaltFactory.php.

References GeneralUtility\getUserObj().

Member Data Documentation

$instance = null
staticprotected

Definition at line 29 of file SaltFactory.php.