|
ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Inheritance diagram for ilBcryptPasswordEncoder:
Collaboration diagram for ilBcryptPasswordEncoder:Public Member Functions | ||||||||||
| __construct (array $config=array()) | ||||||||||
| getDataDirectory () | ||||||||||
| setDataDirectory ($data_directory) | ||||||||||
| 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) | ||||||||||
| 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 () | ||||||||||
{
| ||||||||||
| requiresSalt () | ||||||||||
{{Returns whether or not the encoder requires a salt.
| ||||||||||
| requiresReencoding ($encoded) | ||||||||||
{{{Returns whether or not the a encoded password needs to be re-encoded.
| ||||||||||
| getClientSaltLocation () | ||||||||||
Public Member Functions inherited from ilBcryptPhpPasswordEncoder | ||||||||||
| __construct (array $config=array()) | ||||||||||
| benchmarkCost ($time_target=0.05) | ||||||||||
| getName () | ||||||||||
| isSupportedByRuntime () | ||||||||||
{{Returns whether or not the encoder is supported by the runtime (PHP, HHVM, ...)
| ||||||||||
| 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.
| ||||||||||
| requiresReencoding ($encoded) | ||||||||||
{{Returns whether or not the a encoded password needs to be re-encoded.
| ||||||||||
| isSupportedByRuntime () | ||||||||||
{Returns whether or not the encoder is supported by the runtime (PHP, HHVM, ...)
| ||||||||||
| requiresSalt () | ||||||||||
{Returns whether or not the encoder requires a salt.
| ||||||||||
| requiresReencoding ($encoded) | ||||||||||
{Returns whether or not the a encoded password needs to be re-encoded.
| ||||||||||
| 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... | ||||||||||
| requiresReencoding ($encoded) | ||||||||||
| Returns whether or not the a encoded password needs to be re-encoded. More... | ||||||||||
| isSupportedByRuntime () | ||||||||||
| Returns whether or not the encoder is supported by the runtime (PHP, HHVM, ...) 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... | |
| init () | |
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... | |
Private Member Functions | |
| readClientSalt () | |
| generateClientSalt () | |
| storeClientSalt () | |
Private Attributes | |
| $client_salt = null | |
| $is_security_flaw_ignored = false | |
| $backward_compatibility = false | |
| $data_directory = '' | |
Additional Inherited Members | |
Protected Attributes inherited from ilBcryptPhpPasswordEncoder | |
| $costs = '08' | |
Definition at line 11 of file class.ilBcryptPasswordEncoder.php.
| ilBcryptPasswordEncoder::__construct | ( | array | $config = array() | ) |
| array | $config |
| ilPasswordException |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 47 of file class.ilBcryptPasswordEncoder.php.
References $config, $key, setDataDirectory(), 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 253 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 212 of file class.ilBcryptPasswordEncoder.php.
References getClientSalt(), ilBcryptPhpPasswordEncoder\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 |
| ilPasswordException |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 151 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 286 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 134 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 262 of file class.ilBcryptPasswordEncoder.php.
References getDataDirectory(), 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::getDataDirectory | ( | ) |
Definition at line 85 of file class.ilBcryptPasswordEncoder.php.
References $data_directory.
Referenced by getClientSaltLocation().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::getName | ( | ) |
{
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 182 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testNameShouldBeBcrypt().
Here is the caller graph for this function:
|
protected |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 69 of file class.ilBcryptPasswordEncoder.php.
References readClientSalt().
Here is the call graph for this function:| ilBcryptPasswordEncoder::isBackwardCompatibilityEnabled | ( | ) |
Definition at line 101 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
Referenced by encode().
Here is the caller graph for this function:
|
protected |
Definition at line 77 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 |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 169 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 118 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 270 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::requiresReencoding | ( | $encoded | ) |
{{{Returns whether or not the a encoded password needs to be re-encoded.
| $encoded | string |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 200 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderDoesNotSupportReencoding().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::requiresSalt | ( | ) |
{{Returns whether or not the encoder requires a salt.
Reimplemented from ilBasePasswordEncoder.
Definition at line 190 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderReliesOnSalts().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setBackwardCompatibility | ( | $backward_compatibility | ) |
Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+.
| boolean | $backward_compatibility |
Definition at line 110 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
| ilBcryptPasswordEncoder::setClientSalt | ( | $client_salt | ) |
| string | null | $client_salt |
Definition at line 142 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by generateClientSalt(), and readClientSalt().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setDataDirectory | ( | $data_directory | ) |
| string | $data_directory |
Definition at line 93 of file class.ilBcryptPasswordEncoder.php.
References $data_directory.
Referenced by __construct().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setIsSecurityFlawIgnored | ( | $is_security_flaw_ignored | ) |
| boolean | $is_security_flaw_ignored |
Definition at line 126 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 297 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:
|
private |
Definition at line 36 of file class.ilBcryptPasswordEncoder.php.
Referenced by isBackwardCompatibilityEnabled(), and setBackwardCompatibility().
|
private |
Definition at line 26 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSalt(), and setClientSalt().
|
private |
Definition at line 41 of file class.ilBcryptPasswordEncoder.php.
Referenced by getDataDirectory(), and setDataDirectory().
|
private |
Definition at line 31 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().