‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash Class Reference
Inheritance diagram for TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash:
TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashInterface

Public Member Functions

 __construct ()
 
 checkPassword (string $plainPW, string $saltedHashPW)
 
 isAvailable ()
 
 getHashedPassword (string $password)
 
 isHashUpdateNeeded (string $passString)
 
 isValidSaltedPW (string $saltedPW)
 

Static Public Member Functions

static registerNoopPasswordHash ()
 
static unregisterNoopPasswordHash ()
 

Protected Attributes

const PREFIX = '$SHA1$'
 

Detailed Description

A special noop password "hashing" algorithm to be used in tests only - it is unsecure and optimized for speed.

Definition at line 28 of file NoopPasswordHash.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::__construct ( )

Definition at line 32 of file NoopPasswordHash.php.

References TYPO3\CMS\Core\Core\Environment\getContext().

Member Function Documentation

◆ checkPassword()

TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::checkPassword ( string  $plainPW,
string  $saltedHashPW 
)

Method checks if a given plaintext password is correct by comparing it with a given salted hashed password.

Parameters
string$plainPW‪plain-text password to compare with salted hash
string$saltedHashPW‪Salted hash to compare plain-text password with
Returns
‪bool TRUE, if plaintext password is correct, otherwise FALSE

Implements TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashInterface.

Definition at line 42 of file NoopPasswordHash.php.

References TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash\getHashedPassword().

◆ getHashedPassword()

TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::getHashedPassword ( string  $password)

Method creates a hash for a given plaintext password

Parameters
string$password‪Plaintext password to create a hash from
Returns
‪string|null Hashed password or null on empty password

Implements TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashInterface.

Definition at line 52 of file NoopPasswordHash.php.

Referenced by TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash\checkPassword().

◆ isAvailable()

TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::isAvailable ( )

Returns whether all prerequisites for the hashing methods are matched

Returns
‪bool Method available

Implements TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashInterface.

Definition at line 47 of file NoopPasswordHash.php.

◆ isHashUpdateNeeded()

TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::isHashUpdateNeeded ( string  $passString)

Checks whether a user's hashed password needs to be replaced with a new hash.

This is typically called during the login process when the plain text password is available. A new hash is needed when the desired iteration count has changed through a change in the variable $hashCount or HASH_COUNT.

Parameters
string$passString‪Salted hash to check if it needs an update
Returns
‪bool TRUE if salted hash needs an update, otherwise FALSE

Implements TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashInterface.

Definition at line 57 of file NoopPasswordHash.php.

◆ isValidSaltedPW()

TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::isValidSaltedPW ( string  $saltedPW)

Method determines if a given string is a valid salted hashed password.

Parameters
string$saltedPW‪String to check
Returns
‪bool TRUE if it's valid salted hashed password, otherwise FALSE

Implements TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashInterface.

Definition at line 62 of file NoopPasswordHash.php.

◆ registerNoopPasswordHash()

static TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::registerNoopPasswordHash ( )
static

◆ unregisterNoopPasswordHash()

static TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::unregisterNoopPasswordHash ( )
static

Member Data Documentation

◆ PREFIX

const TYPO3\CMS\Core\Tests\Unit\Authentication\Mfa\Provider\Fixtures\Crypto\PasswordHashing\NoopPasswordHash::PREFIX = '$SHA1$'
protected

Definition at line 30 of file NoopPasswordHash.php.