|
ILIAS
release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
|
Inheritance diagram for ilBcryptPasswordEncoder:
Collaboration diagram for ilBcryptPasswordEncoder:Public Member Functions | ||||||||||
| __construct (array $config=array()) | ||||||||||
| isBackwardCompatibilityEnabled () | ||||||||||
| setBackwardCompatibility ($backward_compatibility) | ||||||||||
| Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+. More... | ||||||||||
| isSecurityFlawIgnored () | ||||||||||
| setIsSecurityFlawIgnored ($is_security_flaw_ignored) | ||||||||||
| getClientSalt () | ||||||||||
| setClientSalt ($client_salt) | ||||||||||
| getCosts () | ||||||||||
| setCosts ($costs) | ||||||||||
| encodePassword ($raw, $salt) | ||||||||||
{Encodes the raw password.
| ||||||||||
| isPasswordValid ($encoded, $raw, $salt) | ||||||||||
{Checks a raw password against an encoded password.The raw password has to be injected into the encoder instance before.
| ||||||||||
| getName () | ||||||||||
{Returns a unique name/id of the concrete password encoder.
| ||||||||||
| requiresSalt () | ||||||||||
{Returns whether or not the encoder requires a salt.
| ||||||||||
| getClientSaltLocation () | ||||||||||
| encodePassword ($raw, $salt) | ||||||||||
| Encodes the raw password. More... | ||||||||||
| isPasswordValid ($encoded, $raw, $salt) | ||||||||||
| Checks a raw password against an encoded password. More... | ||||||||||
| getName () | ||||||||||
| Returns a unique name/id of the concrete password encoder. More... | ||||||||||
| requiresSalt () | ||||||||||
| Returns whether or not the encoder requires a salt. More... | ||||||||||
Data Fields | |
| const | MIN_SALT_SIZE = 16 |
| const | SALT_STORAGE_FILENAME = 'pwsalt.txt' |
Data Fields inherited from ilBasePasswordEncoder | |
| const | MAX_PASSWORD_LENGTH = 4096 |
Protected Member Functions | |
| init () | |
| isBcryptSupported () | |
| encode ($raw, $user_secret) | |
| Generates a bcrypt encoded string. More... | |
| check ($encoded, $raw, $salt) | |
| Verifies a bcrypt encoded string. More... | |
Protected Member Functions inherited from ilBasePasswordEncoder | |
| comparePasswords ($known_string, $user_string) | |
| Compares two passwords. More... | |
| isPasswordTooLong ($password) | |
| Checks if the password is too long. More... | |
Protected Attributes | |
| $client_salt = null | |
| $costs = '08' | |
| $is_security_flaw_ignored = false | |
| $backward_compatibility = false | |
Private Member Functions | |
| readClientSalt () | |
| generateClientSalt () | |
| storeClientSalt () | |
Definition at line 11 of file class.ilBcryptPasswordEncoder.php.
| ilBcryptPasswordEncoder::__construct | ( | array | $config = array() | ) |
| array | $config |
| ilPasswordException |
Definition at line 47 of file class.ilBcryptPasswordEncoder.php.
References init(), setCosts(), and setIsSecurityFlawIgnored().
Here is the call graph for this function:
|
protected |
Verifies a bcrypt encoded string.
| string | $encoded | |
| string | $raw | |
| string | $salt |
Definition at line 264 of file class.ilBcryptPasswordEncoder.php.
References getClientSalt().
Referenced by isPasswordValid().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Generates a bcrypt encoded string.
| string | $raw | The raw password |
| string | $user_secret | A randomly generated string (should be 16 ASCII chars) |
| ilPasswordException |
Check for security flaw in the bcrypt implementation used by crypt()
Definition at line 218 of file class.ilBcryptPasswordEncoder.php.
References getClientSalt(), getCosts(), isBackwardCompatibilityEnabled(), isBcryptSupported(), and isSecurityFlawIgnored().
Referenced by encodePassword().
Here is the call graph for this function:
Here is the caller graph for this function:| ilBcryptPasswordEncoder::encodePassword | ( | $raw, | |
| $salt | |||
| ) |
{Encodes the raw password.
| string | $raw | The password to encode |
| string | $salt | The salt |
| ilPasswordException |
Implements ilPasswordEncoder.
Definition at line 164 of file class.ilBcryptPasswordEncoder.php.
References encode(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), and ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 301 of file class.ilBcryptPasswordEncoder.php.
References ilPasswordUtils\getBytes(), and setClientSalt().
Referenced by readClientSalt().
Here is the call graph for this function:
Here is the caller graph for this function:| ilBcryptPasswordEncoder::getClientSalt | ( | ) |
Definition at line 121 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by check(), encode(), encodePassword(), isPasswordValid(), and storeClientSalt().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::getClientSaltLocation | ( | ) |
Definition at line 273 of file class.ilBcryptPasswordEncoder.php.
References ilUtil\getDataDir(), and SALT_STORAGE_FILENAME.
Referenced by readClientSalt(), and storeClientSalt().
Here is the call graph for this function:
Here is the caller graph for this function:| ilBcryptPasswordEncoder::getCosts | ( | ) |
Definition at line 137 of file class.ilBcryptPasswordEncoder.php.
References $costs.
Referenced by encode(), and ilBcryptPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::getName | ( | ) |
{Returns a unique name/id of the concrete password encoder.
Implements ilPasswordEncoder.
Definition at line 198 of file class.ilBcryptPasswordEncoder.php.
|
protected |
Definition at line 72 of file class.ilBcryptPasswordEncoder.php.
References readClientSalt().
Referenced by __construct().
Here is the call graph for this function:
Here is the caller graph for this function:| ilBcryptPasswordEncoder::isBackwardCompatibilityEnabled | ( | ) |
Definition at line 88 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
Referenced by encode().
Here is the caller graph for this function:
|
protected |
Definition at line 80 of file class.ilBcryptPasswordEncoder.php.
Referenced by encode().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::isPasswordValid | ( | $encoded, | |
| $raw, | |||
| $salt | |||
| ) |
{Checks a raw password against an encoded password.The raw password has to be injected into the encoder instance before.
| string | $encoded | An encoded password |
| string | $raw | A raw password |
| string | $salt | The salt |
Implements ilPasswordEncoder.
Definition at line 184 of file class.ilBcryptPasswordEncoder.php.
References check(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength().
Here is the call graph for this function:
Here is the caller graph for this function:| ilBcryptPasswordEncoder::isSecurityFlawIgnored | ( | ) |
Definition at line 105 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by encode().
Here is the caller graph for this function:
|
private |
Definition at line 281 of file class.ilBcryptPasswordEncoder.php.
References generateClientSalt(), getClientSaltLocation(), setClientSalt(), and storeClientSalt().
Referenced by init().
Here is the call graph for this function:
Here is the caller graph for this function:| ilBcryptPasswordEncoder::requiresSalt | ( | ) |
{Returns whether or not the encoder requires a salt.
Implements ilPasswordEncoder.
Definition at line 206 of file class.ilBcryptPasswordEncoder.php.
| ilBcryptPasswordEncoder::setBackwardCompatibility | ( | $backward_compatibility | ) |
Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+.
| boolean | $backward_compatibility |
Definition at line 97 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
| ilBcryptPasswordEncoder::setClientSalt | ( | $client_salt | ) |
| string | null | $client_salt |
Definition at line 129 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by generateClientSalt(), and readClientSalt().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setCosts | ( | $costs | ) |
| string | $costs |
| ilPasswordException |
Definition at line 146 of file class.ilBcryptPasswordEncoder.php.
References $costs.
Referenced by __construct(), ilBcryptPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet(), ilBcryptPasswordEncoderTest\testCostsCanBeSetInRange(), ilBcryptPasswordEncoderTest\testCostsCannotBeSetAboveRange(), ilBcryptPasswordEncoderTest\testCostsCannotBeSetBelowRange(), ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setIsSecurityFlawIgnored | ( | $is_security_flaw_ignored | ) |
| boolean | $is_security_flaw_ignored |
Definition at line 113 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by __construct().
Here is the caller graph for this function:
|
private |
| ilPasswordException |
Definition at line 312 of file class.ilBcryptPasswordEncoder.php.
References $result, getClientSalt(), and getClientSaltLocation().
Referenced by readClientSalt().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 41 of file class.ilBcryptPasswordEncoder.php.
Referenced by isBackwardCompatibilityEnabled(), and setBackwardCompatibility().
|
protected |
Definition at line 26 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSalt(), and setClientSalt().
|
protected |
Definition at line 31 of file class.ilBcryptPasswordEncoder.php.
Referenced by getCosts(), and setCosts().
|
protected |
Definition at line 36 of file class.ilBcryptPasswordEncoder.php.
Referenced by isSecurityFlawIgnored(), and setIsSecurityFlawIgnored().
| const ilBcryptPasswordEncoder::MIN_SALT_SIZE = 16 |
Definition at line 16 of file class.ilBcryptPasswordEncoder.php.
| const ilBcryptPasswordEncoder::SALT_STORAGE_FILENAME = 'pwsalt.txt' |
Definition at line 21 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSaltLocation(), and ilBcryptPasswordEncoderTest\testInstanceCanBeCreatedAndInitializedWithClientSalt().