|
ILIAS
release_7 Revision v7.30-3-g800a261c036
|
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) | |
| @inheritDoc More... | |
| isPasswordValid (string $encoded, string $raw, string $salt) | |
| @inheritDoc More... | |
| getName () | |
| @inheritDoc More... | |
| requiresSalt () | |
| @inheritDoc More... | |
| requiresReencoding (string $encoded) | |
| @inheritDoc More... | |
| getClientSaltLocation () | |
Public Member Functions inherited from ilBcryptPhpPasswordEncoder | |
| __construct (array $config=[]) | |
| benchmarkCost (float $time_target=0.05) | |
| getName () | |
| isSupportedByRuntime () | |
| @inheritDoc More... | |
| getCosts () | |
| setCosts (string $costs) | |
| encodePassword (string $raw, string $salt) | |
| @inheritDoc More... | |
| isPasswordValid (string $encoded, string $raw, string $salt) | |
| @inheritDoc More... | |
| requiresReencoding (string $encoded) | |
| @inheritDoc More... | |
| isSupportedByRuntime () | |
| @inheritDoc More... | |
| requiresSalt () | |
| @inheritDoc More... | |
| requiresReencoding (string $encoded) | |
| @inheritDoc 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 or not the encoder requires a salt. More... | |
| requiresReencoding (string $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 (string $raw, string $userSecret) | |
| Generates a bcrypt encoded string. More... | |
| check (string $encoded, string $raw, string $salt) | |
| Verifies a bcrypt encoded string. More... | |
| init () | |
Protected Member Functions inherited from ilBasePasswordEncoder | |
| comparePasswords (string $knownString, string $userString) | |
| Compares two passwords. More... | |
| isPasswordTooLong (string $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 12 of file class.ilBcryptPasswordEncoder.php.
| ilBcryptPasswordEncoder::__construct | ( | array | $config = [] | ) |
| array | $config |
| ilPasswordException |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 36 of file class.ilBcryptPasswordEncoder.php.
References $config, ILIAS\GlobalScreen\Provider\__construct(), 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 245 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 |
Generates a bcrypt encoded string.
| string | $raw | The raw password |
| string | $userSecret | A randomly generated string (should be 16 ASCII chars) |
| ilPasswordException |
Check for security flaw in the bcrypt implementation used by crypt()
Definition at line 197 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 | ||
| ) |
@inheritDoc
| ilPasswordException |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 140 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 284 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 123 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 260 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 74 of file class.ilBcryptPasswordEncoder.php.
References $data_directory.
Referenced by getClientSaltLocation().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::getName | ( | ) |
@inheritDoc
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 169 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testNameShouldBeBcrypt().
Here is the caller graph for this function:
|
protected |
| ilPasswordException |
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 90 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 66 of file class.ilBcryptPasswordEncoder.php.
Referenced by encode().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::isPasswordValid | ( | string | $encoded, |
| string | $raw, | ||
| string | $salt | ||
| ) |
@inheritDoc
| ilPasswordException |
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 157 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 107 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by encode().
Here is the caller graph for this function:
|
private |
| ilPasswordException |
Definition at line 268 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 | ) |
@inheritDoc
Reimplemented from ilBcryptPhpPasswordEncoder.
Definition at line 185 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderDoesNotSupportReencoding().
Here is the caller graph for this function:| ilBcryptPasswordEncoder::requiresSalt | ( | ) |
@inheritDoc
Reimplemented from ilBasePasswordEncoder.
Definition at line 177 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+.
| boolean | $backward_compatibility |
Definition at line 99 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 | ) |
| string | null | $client_salt |
Definition at line 131 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 | ) |
| string | $data_directory |
Definition at line 82 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 | ) |
| boolean | $is_security_flaw_ignored |
Definition at line 115 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 |
| ilPasswordException |
Definition at line 294 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 27 of file class.ilBcryptPasswordEncoder.php.
Referenced by isBackwardCompatibilityEnabled(), and setBackwardCompatibility().
|
private |
Definition at line 21 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSalt(), and setClientSalt().
|
private |
Definition at line 30 of file class.ilBcryptPasswordEncoder.php.
Referenced by getDataDirectory(), and setDataDirectory().
|
private |
Definition at line 24 of file class.ilBcryptPasswordEncoder.php.
Referenced by isSecurityFlawIgnored(), and setIsSecurityFlawIgnored().
| const ilBcryptPasswordEncoder::MIN_SALT_SIZE = 16 |
Definition at line 15 of file class.ilBcryptPasswordEncoder.php.
| const ilBcryptPasswordEncoder::SALT_STORAGE_FILENAME = 'pwsalt.txt' |
Definition at line 18 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSaltLocation(), and ilBcryptPasswordEncoderTest\testInstanceCanBeCreatedAndInitializedWithClientSalt().