37 $this->objectInstance = $this->getMock(
'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt', array(
'dummy'));
48 $warningMsg =
'MD5 is not supported on your platform. ' .
'Then, some of the md5 tests will fail.';
57 $hasCorrectBaseClass = get_class($this->objectInstance) ===
'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt';
59 if (!$hasCorrectBaseClass && FALSE != get_parent_class($this->objectInstance)) {
60 $hasCorrectBaseClass = is_subclass_of($this->objectInstance,
'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt');
62 $this->assertTrue($hasCorrectBaseClass);
69 $this->assertTrue($this->objectInstance->getSaltLength() > 0);
77 $this->assertNull($this->objectInstance->getHashedPassword($password));
92 $password =
'password';
93 $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
101 $password =
'password';
104 $salt = $this->objectInstance->base64Encode($randomBytes, $this->objectInstance->getSaltLength());
106 $saltedHashPassword = $this->objectInstance->getHashedPassword($password, $salt);
119 $password =
'aEjOtY';
120 $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
134 $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
147 $password =
' !"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~';
148 $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
162 for ($i = 160; $i <= 191; $i++) {
163 $password .= chr($i);
165 $password .= chr(215) . chr(247);
166 $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
180 for ($i = 192; $i <= 214; $i++) {
181 $password .= chr($i);
183 for ($i = 216; $i <= 246; $i++) {
184 $password .= chr($i);
186 for ($i = 248; $i <= 255; $i++) {
187 $password .= chr($i);
189 $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
197 $password =
'password';
198 $password1 = $password .
'INVALID';
199 $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
208 $criticalPwLength = 0;
210 $saltedHashPasswordCurrent = $salt = $this->objectInstance->getHashedPassword($pad);
211 for ($i = 0; $i <= 128; $i += 8) {
212 $password = str_repeat($pad, max($i, 1));
213 $saltedHashPasswordPrevious = $saltedHashPasswordCurrent;
214 $saltedHashPasswordCurrent = $this->objectInstance->getHashedPassword($password, $salt);
215 if ($i > 0 && $saltedHashPasswordPrevious === $saltedHashPasswordCurrent) {
216 $criticalPwLength = $i;
220 $this->assertTrue($criticalPwLength == 0 || $criticalPwLength > 32, $this->
getWarningWhenMethodUnavailable() .
'Duplicates of hashed passwords with plaintext password of length ' . $criticalPwLength .
'+.');
227 $password =
'password';
228 $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
229 $this->assertFalse($this->objectInstance->isHashUpdateNeeded($saltedHashPassword));
authenticationWithNonValidPassword()
authenticationWithValidLatin1UmlautCharClassPassword()
authenticationWithValidAsciiSpecialCharClassPassword()
nonEmptyPasswordResultsInNonNullSaltedPassword()
createdSaltedHashOfProperStructureForCustomSaltWithoutSetting()
static generateRandomBytes($bytesToReturn)
authenticationWithValidLatin1SpecialCharClassPassword()
getWarningWhenMethodUnavailable()
authenticationWithValidNumericCharClassPassword()
emptyPasswordResultsInNullSaltedPassword()
createdSaltedHashOfProperStructure()
authenticationWithValidAlphaCharClassPassword()
passwordVariationsResultInDifferentHashes()
noUpdateNecessityForMd5()