Project

General

Profile

Bug #22323 » 13908_2.diff

Administrator Admin, 2010-03-27 09:57

View differences:

typo3/sysext/saltedpasswords/tests/tx_saltedpasswords_salts_blowfish_testcase.php (Arbeitskopie)
}
/**
* Tests authentication procedure with alphabet characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidPassword() {
public function authenticationWithValidAlphaCharClassPassword() {
$this->skipTestIfBlowfishIsNotAvailable();
$password = 'password';
$password = 'aEjOtY';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* Tests authentication procedure with numeric characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidNumericCharClassPassword() {
$this->skipTestIfBlowfishIsNotAvailable();
$password = '01369';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* Tests authentication procedure with US-ASCII special characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidAsciiSpecialCharClassPassword() {
$this->skipTestIfBlowfishIsNotAvailable();
$password = ' !"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* Tests authentication procedure with latin1 special characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidLatin1SpecialCharClassPassword() {
$this->skipTestIfBlowfishIsNotAvailable();
$password = '';
for ($i = 160; $i <= 191; $i++) {
$password .= chr($i);
}
$password .= chr(215) . chr(247);
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* Tests authentication procedure with latin1 umlauts.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidLatin1UmlautCharClassPassword() {
$this->skipTestIfBlowfishIsNotAvailable();
$password = '';
for ($i = 192; $i <= 214; $i++) {
$password .= chr($i);
}
for ($i = 216; $i <= 246; $i++) {
$password .= chr($i);
}
for ($i = 248; $i <= 255; $i++) {
$password .= chr($i);
}
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* @test
*/
public function authenticationWithNonValidPassword() {
$this->skipTestIfBlowfishIsNotAvailable();
typo3/sysext/saltedpasswords/tests/tx_saltedpasswords_salts_md5_testcase.php (Arbeitskopie)
}
/**
* Tests authentication procedure with alphabet characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidPassword() {
$password = 'password';
public function authenticationWithValidAlphaCharClassPassword() {
$password = 'aEjOtY';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW), $this->getWarningWhenMethodUnavailable());
}
/**
* Tests authentication procedure with numeric characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidNumericCharClassPassword() {
$password = '01369';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW), $this->getWarningWhenMethodUnavailable());
}
/**
* Tests authentication procedure with US-ASCII special characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidAsciiSpecialCharClassPassword() {
$password = ' !"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW), $this->getWarningWhenMethodUnavailable());
}
/**
* Tests authentication procedure with latin1 special characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidLatin1SpecialCharClassPassword() {
$password = '';
for ($i = 160; $i <= 191; $i++) {
$password .= chr($i);
}
$password .= chr(215) . chr(247);
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW), $this->getWarningWhenMethodUnavailable());
}
/**
* Tests authentication procedure with latin1 umlauts.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidLatin1UmlautCharClassPassword() {
$password = '';
for ($i = 192; $i <= 214; $i++) {
$password .= chr($i);
}
for ($i = 216; $i <= 246; $i++) {
$password .= chr($i);
}
for ($i = 248; $i <= 255; $i++) {
$password .= chr($i);
}
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW), $this->getWarningWhenMethodUnavailable());
}
/**
* @test
*/
public function authenticationWithNonValidPassword() {
$password = 'password';
$password1 = $password . 'INVALID';
typo3/sysext/saltedpasswords/tests/tx_saltedpasswords_salts_phpass_testcase.php (Arbeitskopie)
}
/**
* Tests authentication procedure with alphabet characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidPassword() {
$password = 'password';
public function authenticationWithValidAlphaCharClassPassword() {
$password = 'aEjOtY';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* Tests authentication procedure with numeric characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidNumericCharClassPassword() {
$password = '01369';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* Tests authentication procedure with US-ASCII special characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidAsciiSpecialCharClassPassword() {
$password = ' !"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~';
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* Tests authentication procedure with latin1 special characters.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidLatin1SpecialCharClassPassword() {
$password = '';
for ($i = 160; $i <= 191; $i++) {
$password .= chr($i);
}
$password .= chr(215) . chr(247);
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* Tests authentication procedure with latin1 umlauts.
*
* Checks if a "plain-text password" is everytime mapped to the
* same "salted password hash" when using the same salt.
*
* @test
*/
public function authenticationWithValidLatin1UmlautCharClassPassword() {
$password = '';
for ($i = 192; $i <= 214; $i++) {
$password .= chr($i);
}
for ($i = 216; $i <= 246; $i++) {
$password .= chr($i);
}
for ($i = 248; $i <= 255; $i++) {
$password .= chr($i);
}
$saltedHashPW = $this->objectInstance->getHashedPassword($password);
$this->assertTrue($this->objectInstance->checkPassword($password, $saltedHashPW));
}
/**
* @test
*/
public function authenticationWithNonValidPassword() {
$password = 'password';
$password1 = $password . 'INVALID';
(3-3/4)