[Hastymail-cvs] hastymail/lib imap.php,1.265,1.266
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2004-08-31 17:36:33
|
Update of /cvsroot/hastymail/hastymail/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8189/lib Modified Files: imap.php Log Message: cram-md5 auth fixes Index: imap.php =================================================================== RCS file: /cvsroot/hastymail/hastymail/lib/imap.php,v retrieving revision 1.265 retrieving revision 1.266 diff -u -d -r1.265 -r1.266 --- imap.php 18 Aug 2004 05:23:35 -0000 1.265 +++ imap.php 31 Aug 2004 17:36:24 -0000 1.266 @@ -102,9 +102,10 @@ $result[0] = fgets($is, 1024); if (isset($config['imap_auth']) && strtolower($config['imap_auth']) == 'cram-md5') { + $key = $pass; fputs ($is, 'A0001 AUTHENTICATE CRAM-MD5'."\r\n"); $response = fgets($is, 1024); - $challenge = base64_decode(substr($response, 4)); + $challenge = base64_decode(substr(trim($response), 2)); $key .= str_repeat(chr(0x00), (64-strlen($key))); $ipad = str_repeat(chr(0x36), 64); $opad = str_repeat(chr(0x5c), 64); @@ -140,8 +141,8 @@ } else { if ($debug) { - echo 'The imap server did not like us, it said: <font color="blue">', - $result[$n],'</font><br>'; + echo 'The imap server did not like "',$user, + '" it said: <font color="blue">', $result[$n],'</font><br>'; exit; } return false; |