You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-07-31 10:04:20 +03:00
token fixes; code looks incomplete anyway
This commit is contained in:
@ -1,15 +1,19 @@
|
||||
<?php
|
||||
|
||||
define('SHA1_RESULTLEN', (160/8));
|
||||
define('SHA256_RESULTLEN', (256 / 8));
|
||||
define('CRAM_MD5_CONTEXTLEN', 32);
|
||||
define('MD5_RESULTLEN', (128/8));
|
||||
define('MD4_RESULTLEN', (128/8));
|
||||
define('LM_HASH_SIZE', 16);
|
||||
define('NTLMSSP_HASH_SIZE', 16);
|
||||
define('SHA1_RESULTLEN', (160/8));
|
||||
define('SHA256_RESULTLEN', (256 / 8));
|
||||
define('CRAM_MD5_CONTEXTLEN', 32);
|
||||
define('MD5_RESULTLEN', (128/8));
|
||||
define('MD4_RESULTLEN', (128/8));
|
||||
define('LM_HASH_SIZE', 16);
|
||||
define('NTLMSSP_HASH_SIZE', 16);
|
||||
|
||||
|
||||
class DovecotCrypt extends Crypt {
|
||||
|
||||
|
||||
private $errormsg = [];
|
||||
|
||||
private $salt_chars = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
|
||||
@ -83,7 +87,7 @@ class DovecotCrypt extends Crypt {
|
||||
return $password;
|
||||
}
|
||||
private function __md5_generate($plaintext) {
|
||||
return $password;
|
||||
return $plaintext;
|
||||
}
|
||||
private function __sha1_generate() {
|
||||
}
|
||||
@ -91,7 +95,7 @@ class DovecotCrypt extends Crypt {
|
||||
}
|
||||
private function __cram_md5_generate($plaintext) {
|
||||
|
||||
#http://hg.dovecot.org/dovecot-1.2/file/84373d238073/src/lib/hmac-md5.c
|
||||
#http://hg.dovecot.org/dovecot-1.2/file/84373d238073/src/lib/hmac-md5.c
|
||||
#http://hg.dovecot.org/dovecot-1.2/file/84373d238073/src/auth/password-scheme.c cram_md5_generate
|
||||
#am i right that the hmac salt is the plaintext password itself?
|
||||
$salt = $plaintext;
|
||||
@ -103,6 +107,9 @@ class DovecotCrypt extends Crypt {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function custom_hmac($algo, $data, $key, $raw_output = false) {
|
||||
$algo = strtolower($algo);
|
||||
$pack = 'H'.strlen($algo('test'));
|
||||
|
Reference in New Issue
Block a user