ILIAS
Release_5_0_x_branch Revision 61816
|
Public Member Functions | ||||||||||
__construct (array $config=array()) | ||||||||||
isBackwardCompatibilityEnabled () | ||||||||||
setBackwardCompatibility ($backward_compatibility) | ||||||||||
Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+. | ||||||||||
isSecurityFlawIgnored () | ||||||||||
setIsSecurityFlawIgnored ($is_security_flaw_ignored) | ||||||||||
getClientSalt () | ||||||||||
setClientSalt ($client_salt) | ||||||||||
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.
| ||||||||||
getName () | ||||||||||
{Returns a unique name/id of the concrete password encoder.
| ||||||||||
requiresSalt () | ||||||||||
{Returns whether or not the encoder requires a salt.
| ||||||||||
getClientSaltLocation () | ||||||||||
onSelection () | ||||||||||
{A client should call this method when the specific encoder is selected.} | ||||||||||
saveForm (ilPropertyFormGUI $form) | ||||||||||
{
| ||||||||||
Public Member Functions inherited from ilPasswordEncoderConfigurationFormAware | ||||||||||
buildForm (ilPropertyFormGUI $form) | ||||||||||
Called when an encoder should build individual form parts for the user interface. | ||||||||||
validateForm (ilPropertyFormGUI $form) | ||||||||||
Called if an encoder should validate a request concerning business rules. |
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, $salt) | |
Generates a bcrypt encoded string. | |
check ($encoded, $raw, $salt) | |
Verifies a bcrypt encoded string. | |
Protected Member Functions inherited from ilBasePasswordEncoder | |
comparePasswords ($known_string, $user_string) | |
Compares two passwords. | |
isPasswordTooLong ($password) | |
Checks if the password is too long. |
Protected Attributes | |
$client_salt = null | |
$costs = '08' | |
$is_security_flaw_ignored = false | |
$backward_compatibility = false |
Private Member Functions | |
generateClientSalt () | |
readClientSalt () | |
storeClientSalt () |
Definition at line 12 of file class.ilBcryptPasswordEncoder.php.
ilBcryptPasswordEncoder::__construct | ( | array | $config = array() | ) |
array | $config |
ilPasswordException |
Definition at line 48 of file class.ilBcryptPasswordEncoder.php.
References init(), setCosts(), and setIsSecurityFlawIgnored().
|
protected |
Verifies a bcrypt encoded string.
string | $encoded | |
string | $raw | |
string | $salt |
Definition at line 263 of file class.ilBcryptPasswordEncoder.php.
References getClientSalt().
Referenced by isPasswordValid().
|
protected |
Generates a bcrypt encoded string.
string | $raw | |
string | $salt |
ilPasswordException |
Check for security flaw in the bcrypt implementation used by crypt()
Definition at line 219 of file class.ilBcryptPasswordEncoder.php.
References getClientSalt(), 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 165 of file class.ilBcryptPasswordEncoder.php.
References encode(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), and ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified().
|
private |
Definition at line 280 of file class.ilBcryptPasswordEncoder.php.
References ilPasswordUtils\getBytes(), and setClientSalt().
Referenced by onSelection().
ilBcryptPasswordEncoder::getClientSalt | ( | ) |
Definition at line 122 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by check(), encode(), encodePassword(), isPasswordValid(), onSelection(), and storeClientSalt().
ilBcryptPasswordEncoder::getClientSaltLocation | ( | ) |
Definition at line 272 of file class.ilBcryptPasswordEncoder.php.
References ilUtil\getDataDir(), and SALT_STORAGE_FILENAME.
Referenced by readClientSalt(), and storeClientSalt().
ilBcryptPasswordEncoder::getCosts | ( | ) |
Definition at line 138 of file class.ilBcryptPasswordEncoder.php.
References $costs.
Referenced by encode(), and ilBcryptPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet().
ilBcryptPasswordEncoder::getName | ( | ) |
{Returns a unique name/id of the concrete password encoder.
Implements ilPasswordEncoder.
Definition at line 199 of file class.ilBcryptPasswordEncoder.php.
|
protected |
Definition at line 73 of file class.ilBcryptPasswordEncoder.php.
References readClientSalt().
Referenced by __construct().
ilBcryptPasswordEncoder::isBackwardCompatibilityEnabled | ( | ) |
Definition at line 89 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
Referenced by encode().
|
protected |
Definition at line 81 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 185 of file class.ilBcryptPasswordEncoder.php.
References check(), getClientSalt(), and ilBasePasswordEncoder\isPasswordTooLong().
Referenced by ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength().
ilBcryptPasswordEncoder::isSecurityFlawIgnored | ( | ) |
Definition at line 106 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by encode().
ilBcryptPasswordEncoder::onSelection | ( | ) |
{A client should call this method when the specific encoder is selected.}
ilPasswordException |
Implements ilPasswordEncoderConfigurationFormAware.
Definition at line 319 of file class.ilBcryptPasswordEncoder.php.
References generateClientSalt(), getClientSalt(), setClientSalt(), and storeClientSalt().
|
private |
Definition at line 291 of file class.ilBcryptPasswordEncoder.php.
References getClientSaltLocation(), and setClientSalt().
Referenced by init().
ilBcryptPasswordEncoder::requiresSalt | ( | ) |
{Returns whether or not the encoder requires a salt.
Implements ilPasswordEncoder.
Definition at line 207 of file class.ilBcryptPasswordEncoder.php.
ilBcryptPasswordEncoder::saveForm | ( | ilPropertyFormGUI | $form | ) |
{
ilPropertyFormGUI | $form |
Implements ilPasswordEncoderConfigurationFormAware.
Definition at line 358 of file class.ilBcryptPasswordEncoder.php.
ilBcryptPasswordEncoder::setBackwardCompatibility | ( | $backward_compatibility | ) |
Set the backward compatibility $2a$ instead of $2y$ for PHP 5.3.7+.
boolean | $backward_compatibility |
Definition at line 98 of file class.ilBcryptPasswordEncoder.php.
References $backward_compatibility.
ilBcryptPasswordEncoder::setClientSalt | ( | $client_salt | ) |
string | null | $client_salt |
Definition at line 130 of file class.ilBcryptPasswordEncoder.php.
References $client_salt.
Referenced by generateClientSalt(), onSelection(), and readClientSalt().
ilBcryptPasswordEncoder::setCosts | ( | $costs | ) |
string | $costs |
ilPasswordException |
Definition at line 147 of file class.ilBcryptPasswordEncoder.php.
References $costs.
Referenced by __construct(), ilBcryptPasswordEncoderTest\testCostsCanBeRetrievedWhenCostsAreSet(), ilBcryptPasswordEncoderTest\testCostsCanBeSetInRange(), ilBcryptPasswordEncoderTest\testCostsCannotBeSetAboveRange(), ilBcryptPasswordEncoderTest\testCostsCannotBeSetBelowRange(), ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfThePasswordExceedsTheSupportedLengthOnEncoding(), ilBcryptPasswordEncoderTest\testPasswordShouldBeCorrectlyEncodedAndVerified(), and ilBcryptPasswordEncoderTest\testPasswordVerificationShouldFailIfTheRawPasswordExceedsTheSupportedLength().
ilBcryptPasswordEncoder::setIsSecurityFlawIgnored | ( | $is_security_flaw_ignored | ) |
boolean | $is_security_flaw_ignored |
Definition at line 114 of file class.ilBcryptPasswordEncoder.php.
References $is_security_flaw_ignored.
Referenced by __construct().
|
private |
ilPasswordException |
Definition at line 306 of file class.ilBcryptPasswordEncoder.php.
References $result, getClientSalt(), and getClientSaltLocation().
Referenced by onSelection().
|
protected |
Definition at line 42 of file class.ilBcryptPasswordEncoder.php.
Referenced by isBackwardCompatibilityEnabled(), and setBackwardCompatibility().
|
protected |
Definition at line 27 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSalt(), and setClientSalt().
|
protected |
Definition at line 32 of file class.ilBcryptPasswordEncoder.php.
Referenced by getCosts(), and setCosts().
|
protected |
Definition at line 37 of file class.ilBcryptPasswordEncoder.php.
Referenced by isSecurityFlawIgnored(), and setIsSecurityFlawIgnored().
const ilBcryptPasswordEncoder::MIN_SALT_SIZE = 16 |
Definition at line 17 of file class.ilBcryptPasswordEncoder.php.
const ilBcryptPasswordEncoder::SALT_STORAGE_FILENAME = 'pwsalt.txt' |
Definition at line 22 of file class.ilBcryptPasswordEncoder.php.
Referenced by getClientSaltLocation(), ilBcryptPasswordEncoderTest\testClientSaltIsGeneratedAndStoredOnEncoderSelection(), ilBcryptPasswordEncoderTest\testExceptionIsRaisedIfAGeneratedClientSaltCouldNotBeStoredOnEncoderSelection(), and ilBcryptPasswordEncoderTest\testInstanceCanBeCreatedAndInitializedWithClientSalt().