|
ILIAS
release_8 Revision v8.24
|
Inheritance diagram for ilBcryptPasswordEncoder:
Collaboration diagram for ilBcryptPasswordEncoder:Public Member Functions | |
| __construct (array $config=[]) | |
| getDataDirectory () | |
| setDataDirectory (string $data_directory) | |
| isBackwardCompatibilityEnabled () | |
| setBackwardCompatibility (bool $backward_compatibility) | |
| Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+. More... | |
| isSecurityFlawIgnored () | |
| setIsSecurityFlawIgnored (bool $is_security_flaw_ignored) | |
| getClientSalt () | |
| setClientSalt (?string $client_salt) | |
| encodePassword (string $raw, string $salt) | |
| Encodes the raw password. More... | |
| isPasswordValid (string $encoded, string $raw, string $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 the encoder requires a salt. More... | |
| requiresReencoding (string $encoded) | |
| Returns whether the encoded password needs to be re-encoded. More... | |
| getClientSaltLocation () | |
Public Member Functions inherited from ilBcryptPhpPasswordEncoder | |
| __construct (array $config=[]) | |
| benchmarkCost (float $time_target=0.05) | |
| getName () | |
| Returns a unique name/id of the concrete password encoder. More... | |
| getCosts () | |
| setCosts (string $costs) | |
| encodePassword (string $raw, string $salt) | |
| Encodes the raw password. More... | |
| isPasswordValid (string $encoded, string $raw, string $salt) | |
| Checks a raw password against an encoded password. More... | |
| requiresReencoding (string $encoded) | |
| Returns whether the encoded password needs to be re-encoded. More... | |
Public Member Functions inherited from ilBasePasswordEncoder | |
| isSupportedByRuntime () | |
| Returns whether the encoder is supported by the runtime (PHP, HHVM, ...) More... | |
| requiresSalt () | |
| Returns whether the encoder requires a salt. More... | |
| requiresReencoding (string $encoded) | |
| Returns whether the encoded password needs to be re-encoded. More... | |
| encodePassword (string $raw, string $salt) | |
| Encodes the raw password. More... | |
| isPasswordValid (string $encoded, string $raw, string $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 the encoder requires a salt. More... | |
| requiresReencoding (string $encoded) | |
| Returns whether the encoded password needs to be re-encoded. More... | |
| isSupportedByRuntime () | |
| Returns whether the encoder is supported by the runtime (PHP, HHVM, ...) More... | |
Data Fields | |
| const | SALT_STORAGE_FILENAME = 'pwsalt.txt' |
Protected Member Functions | |
| init () | |
| isBcryptSupported () | |
| encode (string $raw, string $userSecret) | |
| check (string $encoded, string $raw, string $salt) | |
| init () | |
Protected Member Functions inherited from ilBasePasswordEncoder | |
| comparePasswords (string $knownString, string $userString) | |
| Compares two passwords. More... | |
| isPasswordTooLong (string $password) | |
Private Member Functions | |
| readClientSalt () | |
| generateClientSalt () | |
| storeClientSalt () | |
Private Attributes | |
| const | MIN_SALT_SIZE = 16 |
| string | $client_salt = null |
| bool | $is_security_flaw_ignored = false |
| bool | $backward_compatibility = false |
| string | $data_directory = '' |
Additional Inherited Members | |
Protected Attributes inherited from ilBcryptPhpPasswordEncoder | |
| string | $costs = '08' |
Definition at line 27 of file class.ilBcryptPasswordEncoder.php.
| ilBcryptPasswordEncoder::__construct | ( | array | $config = [] | ) |
| array<string,mixed> | $config |
| ilPasswordException |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 44 of file class.ilBcryptPasswordEncoder.php.
References $config, ILIAS\LTI\ToolProvider\$key, ILIAS\GlobalScreen\Provider\__construct(), setDataDirectory(), and setIsSecurityFlawIgnored().
Here is the call graph for this function:
|
protected |
Definition at line 189 of file class.ilBcryptPasswordEncoder.php.
References ilBasePasswordEncoder\comparePasswords(), and getClientSalt().
Referenced by isPasswordValid().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Check for security flaw in the bcrypt implementation used by crypt()
Definition at line 148 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 | ( | string | $raw, |
| string | $salt | ||
| ) |
Encodes the raw password.
| string | $raw | The password to encode |
| string | $salt | The salt |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 111 of file class.ilBcryptPasswordEncoder.php.
References encode(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testBackwardCompatibility(), ilBcryptPasswordEncoderTest\testExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabled(), ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfSaltIsMissingIsOnEncoding(), and ilBcryptPasswordEncoderTest\testNoExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabledWithIgnoredSecurityFlaw().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 219 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 101 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by check(), encode(), encodePassword(), isPasswordValid(), storeClientSalt(), ilBcryptPasswordEncoderTest\testClientSaltIsGeneratedWhenNoClientSaltExistsYet(), and ilBcryptPasswordEncoderTest\testInstanceCanBeCreatedAndInitializedWithClientSalt().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::getClientSaltLocation | ( | ) |
Definition at line 201 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 68 of file class.ilBcryptPasswordEncoder.php.
References $data_directory.
Referenced by getClientSaltLocation().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::getName | ( | ) |
Returns a unique name/id of the concrete password encoder.
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 133 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testNameShouldBeBcrypt().
Here is the caller graph for this function:
|
protected |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 58 of file class.ilBcryptPasswordEncoder.php.
References readClientSalt().
Here is the call graph for this function:| ilBcryptPasswordEncoder::isBackwardCompatibilityEnabled | ( | ) |
Definition at line 78 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
Referenced by encode(), and ilBcryptPasswordEncoderTest\testBackwardCompatibilityCanBeRetrievedWhenBackwardCompatibilityIsSet().
Here is the caller graph for this function:
|
protected |
Definition at line 63 of file class.ilBcryptPasswordEncoder.php.
Referenced by encode().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::isPasswordValid | ( | string | $encoded, |
| string | $raw, | ||
| string | $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, may be empty |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 124 of file class.ilBcryptPasswordEncoder.php.
References check(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testBackwardCompatibility(), and ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfSaltIsMissingIsOnVerification().
Here is the call graph for this function:
Here is the caller graph for this function:| ilBcryptPasswordEncoder::isSecurityFlawIgnored | ( | ) |
Definition at line 91 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 206 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 | ( | string | $encoded | ) |
Returns whether the encoded password needs to be re-encoded.
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 143 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderDoesNotSupportReencoding().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::requiresSalt | ( | ) |
Returns whether the encoder requires a salt.
Reimplemented from ilBasePasswordEncoder.
Definition at line 138 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderReliesOnSalts().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setBackwardCompatibility | ( | bool | $backward_compatibility | ) |
Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+.
Definition at line 86 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
Referenced by ilBcryptPasswordEncoderTest\testBackwardCompatibility(), ilBcryptPasswordEncoderTest\testBackwardCompatibilityCanBeRetrievedWhenBackwardCompatibilityIsSet(), ilBcryptPasswordEncoderTest\testExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabled(), and ilBcryptPasswordEncoderTest\testNoExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabledWithIgnoredSecurityFlaw().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setClientSalt | ( | ?string | $client_salt | ) |
Definition at line 106 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by generateClientSalt(), readClientSalt(), ilBcryptPasswordEncoderTest\testBackwardCompatibility(), ilBcryptPasswordEncoderTest\testExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabled(), ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfSaltIsMissingIsOnEncoding(), ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfSaltIsMissingIsOnVerification(), and ilBcryptPasswordEncoderTest\testNoExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabledWithIgnoredSecurityFlaw().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setDataDirectory | ( | string | $data_directory | ) |
Definition at line 73 of file class.ilBcryptPasswordEncoder.php.
References $data_directory.
Referenced by __construct().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::setIsSecurityFlawIgnored | ( | bool | $is_security_flaw_ignored | ) |
Definition at line 96 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by __construct(), and ilBcryptPasswordEncoderTest\testNoExceptionIfPasswordsContainA8BitCharacterAndBackwardCompatibilityIsEnabledWithIgnoredSecurityFlaw().
Here is the caller graph for this function:
|
private |
Definition at line 226 of file class.ilBcryptPasswordEncoder.php.
References Vendor\Package\$e, $location, $message, 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 37 of file class.ilBcryptPasswordEncoder.php.
Referenced by isBackwardCompatibilityEnabled(), and setBackwardCompatibility().
|
private |
Definition at line 35 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSalt(), and setClientSalt().
|
private |
Definition at line 38 of file class.ilBcryptPasswordEncoder.php.
Referenced by getDataDirectory(), and setDataDirectory().
|
private |
Definition at line 36 of file class.ilBcryptPasswordEncoder.php.
Referenced by isSecurityFlawIgnored(), and setIsSecurityFlawIgnored().
|
private |
Definition at line 30 of file class.ilBcryptPasswordEncoder.php.
| const ilBcryptPasswordEncoder::SALT_STORAGE_FILENAME = 'pwsalt.txt' |
Definition at line 33 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSaltLocation(), and ilBcryptPasswordEncoderTest\testInstanceCanBeCreatedAndInitializedWithClientSalt().