1
0
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:
David Goodwin
2018-06-18 21:36:25 +01:00
parent 97c48a0fc9
commit aa38d0090d

View File

@ -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'));