|
|
@ -3,7 +3,6 @@
|
|
|
|
require_once('common.php');
|
|
|
|
require_once('common.php');
|
|
|
|
|
|
|
|
|
|
|
|
class PaCryptTest extends PHPUnit_Framework_TestCase {
|
|
|
|
class PaCryptTest extends PHPUnit_Framework_TestCase {
|
|
|
|
|
|
|
|
|
|
|
|
public function testMd5Crypt() {
|
|
|
|
public function testMd5Crypt() {
|
|
|
|
$hash = _pacrypt_md5crypt('test', '');
|
|
|
|
$hash = _pacrypt_md5crypt('test', '');
|
|
|
|
|
|
|
|
|
|
|
@ -23,7 +22,6 @@ class PaCryptTest extends PHPUnit_Framework_TestCase {
|
|
|
|
$this->assertNotEquals('test', $hash);
|
|
|
|
$this->assertNotEquals('test', $hash);
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($hash, _pacrypt_crypt('test', $hash));
|
|
|
|
$this->assertEquals($hash, _pacrypt_crypt('test', $hash));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testMySQLEncrypt() {
|
|
|
|
public function testMySQLEncrypt() {
|
|
|
@ -54,7 +52,6 @@ class PaCryptTest extends PHPUnit_Framework_TestCase {
|
|
|
|
'md5' => 'CY9rzUYh03PK3k6DJie09g==',
|
|
|
|
'md5' => 'CY9rzUYh03PK3k6DJie09g==',
|
|
|
|
// crypt requires salt ...
|
|
|
|
// crypt requires salt ...
|
|
|
|
'SHA' => 'qUqP5cyxm6YcTAhz05Hph5gvu9M='] as $flavour => $hash) {
|
|
|
|
'SHA' => 'qUqP5cyxm6YcTAhz05Hph5gvu9M='] as $flavour => $hash) {
|
|
|
|
|
|
|
|
|
|
|
|
$CONF['authlib_default_flavour'] = $flavour;
|
|
|
|
$CONF['authlib_default_flavour'] = $flavour;
|
|
|
|
|
|
|
|
|
|
|
|
$stored = "{" . $flavour . "}$hash";
|
|
|
|
$stored = "{" . $flavour . "}$hash";
|
|
|
@ -79,10 +76,7 @@ class PaCryptTest extends PHPUnit_Framework_TestCase {
|
|
|
|
$this->assertEquals($expected_hash, _pacrypt_dovecot('test', ''));
|
|
|
|
$this->assertEquals($expected_hash, _pacrypt_dovecot('test', ''));
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($expected_hash, _pacrypt_dovecot('test', $expected_hash));
|
|
|
|
$this->assertEquals($expected_hash, _pacrypt_dovecot('test', $expected_hash));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|
|
|
|
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|
|
|
|