ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
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 () | ||||||||||
{Returns a unique name/id of the concrete password encoder.
| ||||||||||
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.
| ||||||||||
Public Member Functions inherited from ilBasePasswordEncoder | ||||||||||
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.
| ||||||||||
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 ilBcryptPhpPasswordEncoder | |
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 |
Definition at line 47 of file class.ilBcryptPasswordEncoder.php.
References $config, $key, setDataDirectory(), and setIsSecurityFlawIgnored().
|
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().
|
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().
ilBcryptPasswordEncoder::encodePassword | ( | $raw, | |
$salt | |||
) |
{Encodes the raw password.
string | $raw | The password to encode |
string | $salt | The salt |
ilPasswordException |
Implements ilPasswordEncoder.
Definition at line 151 of file class.ilBcryptPasswordEncoder.php.
References encode(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), and ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified().
|
private |
Definition at line 286 of file class.ilBcryptPasswordEncoder.php.
References ilPasswordUtils\getBytes(), and setClientSalt().
Referenced by readClientSalt().
ilBcryptPasswordEncoder::getClientSalt | ( | ) |
Definition at line 134 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by check(), encode(), encodePassword(), isPasswordValid(), and storeClientSalt().
ilBcryptPasswordEncoder::getClientSaltLocation | ( | ) |
Definition at line 262 of file class.ilBcryptPasswordEncoder.php.
References getDataDirectory().
Referenced by readClientSalt(), and storeClientSalt().
ilBcryptPasswordEncoder::getDataDirectory | ( | ) |
Definition at line 85 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 182 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testNameShouldBeBcrypt().
|
protected |
Definition at line 69 of file class.ilBcryptPasswordEncoder.php.
References readClientSalt().
ilBcryptPasswordEncoder::isBackwardCompatibilityEnabled | ( | ) |
Definition at line 101 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
Referenced by encode().
|
protected |
Definition at line 77 of file class.ilBcryptPasswordEncoder.php.
Referenced by encode().
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 169 of file class.ilBcryptPasswordEncoder.php.
References check(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength().
ilBcryptPasswordEncoder::isSecurityFlawIgnored | ( | ) |
Definition at line 118 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by encode().
|
private |
Definition at line 270 of file class.ilBcryptPasswordEncoder.php.
References generateClientSalt(), getClientSaltLocation(), setClientSalt(), and storeClientSalt().
Referenced by init().
ilBcryptPasswordEncoder::requiresReencoding | ( | $encoded | ) |
{Returns whether or not the a encoded password needs to be re-encoded.
$encoded | string |
Implements ilPasswordEncoder.
Definition at line 200 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderDoesNotSupportReencoding().
ilBcryptPasswordEncoder::requiresSalt | ( | ) |
{Returns whether or not the encoder requires a salt.
Implements ilPasswordEncoder.
Definition at line 190 of file class.ilBcryptPasswordEncoder.php.
Referenced by ilBcryptPasswordEncoderTest\testEncoderReliesOnSalts().
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().
ilBcryptPasswordEncoder::setDataDirectory | ( | $data_directory | ) |
string | $data_directory |
Definition at line 93 of file class.ilBcryptPasswordEncoder.php.
References $data_directory.
Referenced by __construct().
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().
|
private |
ilPasswordException |
Definition at line 297 of file class.ilBcryptPasswordEncoder.php.
References $result, getClientSalt(), and getClientSaltLocation().
Referenced by readClientSalt().
|
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 ilBcryptPasswordEncoderTest\testInstanceCanBeCreatedAndInitializedWithClientSalt().