diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-18 06:44:39 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-18 06:44:39 +0000 |
| commit | 83aa51243e5c25ebbcc8a82ede1eae4eb352f117 (patch) | |
| tree | fdaeef49bad698997f2c146910ec9c0b21f0cae7 /roundcubemail | |
| parent | f9664a1ce4acf25ac9284c4dd9af5776dcf53bd0 (diff) | |
Revert changes from r994 and make cram-md5 work again (#1484819)
git-svn-id: https://svn.roundcube.net/trunk@1557 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 4 | ||||
| -rw-r--r-- | roundcubemail/program/lib/imap.inc | 12 |
2 files changed, 7 insertions, 9 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index 7f3fd9a1b..fb3870b29 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -102,7 +102,7 @@ class rcube_imap * @return boolean TRUE on success, FALSE on failure * @access public */ - function connect($host, $user, $pass, $port=143, $use_ssl=null, $auth_type='check') + function connect($host, $user, $pass, $port=143, $use_ssl=null, $auth_type=null) { global $ICL_SSL, $ICL_PORT, $IMAP_USE_INTERNAL_DATE; @@ -119,7 +119,7 @@ class rcube_imap $ICL_PORT = $port; $IMAP_USE_INTERNAL_DATE = false; - $this->conn = iil_Connect($host, $user, $pass, array('imap' => $auth_type)); + $this->conn = iil_Connect($host, $user, $pass, array('imap' => $auth_type ? $auth_type : 'check')); $this->host = $host; $this->user = $user; $this->pass = $pass; diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc index e2cd724da..7a1ac0aa7 100644 --- a/roundcubemail/program/lib/imap.inc +++ b/roundcubemail/program/lib/imap.inc @@ -297,12 +297,10 @@ function iil_C_Authenticate(&$conn, $user, $pass, $encChallenge) { } // generate hash - $hash = iil_xor($pass,$opad); - $hash .= pack("H*", md5(iil_xor($pass, $ipad) . base64_decode($encChallenge))); - $hash = md5($hash); + $hash = md5(iil_xor($pass,$opad) . pack("H*", md5(iil_xor($pass, $ipad) . base64_decode($encChallenge)))); // generate reply - $reply = base64_encode('"' . $user . '" "' . $hash . '"'); + $reply = base64_encode($user . ' ' . $hash); // send result, get reply iil_PutLine($conn->fp, $reply); @@ -544,9 +542,9 @@ function iil_Connect($host, $user, $password) { //do CRAM-MD5 authentication iil_PutLine($conn->fp, "a000 AUTHENTICATE CRAM-MD5"); $line = trim(iil_ReadLine($conn->fp, 1024)); - + $conn->message .= "$line\n"; - + if ($line[0] == '+') { $conn->message .= 'Got challenge: ' . htmlspecialchars($line) . "\n"; @@ -556,7 +554,7 @@ function iil_Connect($host, $user, $password) { $conn->message .= "Tried CRAM-MD5: $result \n"; } else { $conn->message .='No challenge ('.htmlspecialchars($line)."), try plain\n"; - $auth = 'plain'; + $auth = 'plain'; } } |
