ILIAS
release_8 Revision v8.19
|
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 () | |
![]() | |
__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... | |
![]() | |
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... | |
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 () | |
![]() | |
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 | |
![]() | |
string | $costs = '08' |
Definition at line 27 of file class.ilBcryptPasswordEncoder.php.
ilBcryptPasswordEncoder::__construct | ( | array | $config = [] | ) |
array<string,mixed> | $config |
ilPasswordException |
Definition at line 44 of file class.ilBcryptPasswordEncoder.php.
References $config, ILIAS\LTI\ToolProvider\$key, ILIAS\GlobalScreen\Provider\__construct(), setDataDirectory(), and setIsSecurityFlawIgnored().
|
protected |
Definition at line 189 of file class.ilBcryptPasswordEncoder.php.
References ilBasePasswordEncoder\comparePasswords(), and getClientSalt().
Referenced by isPasswordValid().
|
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().
ilBcryptPasswordEncoder::encodePassword | ( | string | $raw, |
string | $salt | ||
) |
Encodes the raw password.
string | $raw | The password to encode |
string | $salt | The salt |
Implements ilPasswordEncoder.
Definition at line 111 of file class.ilBcryptPasswordEncoder.php.
References encode(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), and ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified().
|
private |
Definition at line 219 of file class.ilBcryptPasswordEncoder.php.
References ilPasswordUtils\getBytes(), and setClientSalt().
Referenced by readClientSalt().
ilBcryptPasswordEncoder::getClientSalt | ( | ) |
Definition at line 101 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by check(), encode(), encodePassword(), isPasswordValid(), and storeClientSalt().
ilBcryptPasswordEncoder::getClientSaltLocation | ( | ) |
Definition at line 201 of file class.ilBcryptPasswordEncoder.php.
References getDataDirectory().
Referenced by readClientSalt(), and storeClientSalt().
ilBcryptPasswordEncoder::getDataDirectory | ( | ) |
Definition at line 68 of file class.ilBcryptPasswordEncoder.php.
References $data_directory.
Referenced by getClientSaltLocation().
ilBcryptPasswordEncoder::getName | ( | ) |
Returns a unique name/id of the concrete password encoder.
Implements ilPasswordEncoder.
Definition at line 133 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testNameShouldBeBcrypt().
|
protected |
Definition at line 58 of file class.ilBcryptPasswordEncoder.php.
References readClientSalt().
ilBcryptPasswordEncoder::isBackwardCompatibilityEnabled | ( | ) |
Definition at line 78 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
Referenced by encode().
|
protected |
Definition at line 63 of file class.ilBcryptPasswordEncoder.php.
Referenced by encode().
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 |
Implements ilPasswordEncoder.
Definition at line 124 of file class.ilBcryptPasswordEncoder.php.
References check(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength().
ilBcryptPasswordEncoder::isSecurityFlawIgnored | ( | ) |
Definition at line 91 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by encode().
|
private |
Definition at line 206 of file class.ilBcryptPasswordEncoder.php.
References generateClientSalt(), getClientSaltLocation(), setClientSalt(), and storeClientSalt().
Referenced by init().
ilBcryptPasswordEncoder::requiresReencoding | ( | string | $encoded | ) |
Returns whether the encoded password needs to be re-encoded.
Implements ilPasswordEncoder.
Definition at line 143 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderDoesNotSupportReencoding().
ilBcryptPasswordEncoder::requiresSalt | ( | ) |
Returns whether the encoder requires a salt.
Implements ilPasswordEncoder.
Definition at line 138 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderReliesOnSalts().
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.
ilBcryptPasswordEncoder::setClientSalt | ( | ?string | $client_salt | ) |
Definition at line 106 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by generateClientSalt(), and readClientSalt().
ilBcryptPasswordEncoder::setDataDirectory | ( | string | $data_directory | ) |
Definition at line 73 of file class.ilBcryptPasswordEncoder.php.
References $data_directory.
Referenced by __construct().
ilBcryptPasswordEncoder::setIsSecurityFlawIgnored | ( | bool | $is_security_flaw_ignored | ) |
Definition at line 96 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by __construct().
|
private |
Definition at line 226 of file class.ilBcryptPasswordEncoder.php.
References Vendor\Package\$e, $location, $message, getClientSalt(), and getClientSaltLocation().
Referenced by readClientSalt().
|
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 ilBcryptPasswordEncoderTest\testInstanceCanBeCreatedAndInitializedWithClientSalt().