Changeset 994 in subversion


Ignore:
Timestamp:
Feb 2, 2008 12:50:06 PM (5 years ago)
Author:
till
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/lib/imap.inc

    r992 r994  
    259259     
    260260    // generate hash 
    261     $hash = md5(iil_xor($pass,$opad) . pack("H*",md5(iil_xor($pass, $ipad) . base64_decode($encChallenge)))); 
     261    $hash  = iil_xor($pass,$opad); 
     262    $hash .= pack("H*",md5(iil_xor($pass, $ipad) . base64_decode($encChallenge))); 
     263    $hash  = md5($hash); 
    262264     
    263265    // generate reply 
    264     $reply = base64_encode($user . ' ' . $hash); 
     266    $reply = base64_encode('"' . $user . '" "' . $hash . '"'); 
    265267     
    266268    // send result, get reply 
    267     fputs($conn->fp, $reply."\r\n"); 
     269    fputs($conn->fp, $reply . "\r\n"); 
    268270    $line = iil_ReadLine($conn->fp, 1024); 
    269271     
     
    274276        return $conn->fp; 
    275277    } 
    276     $conn->error    .= 'Authentication for '.$user.' failed (AUTH): "'; 
     278    $conn->error    .= 'Authentication for ' . $user . ' failed (AUTH): "'; 
    277279    $conn->error    .= htmlspecialchars($line) . '"'; 
    278280    $conn->errorNum  = -2; 
     
    499501         
    500502                if ($line[0] == "+") { 
    501                         $conn->message.='Got challenge: '.htmlspecialchars($line)."\n"; 
     503                        $conn->message .= 'Got challenge: ' . htmlspecialchars($line)."\n"; 
     504 
    502505                        //got a challenge string, try CRAM-5 
    503506                        $result = iil_C_Authenticate($conn, $user, $password, substr($line,2)); 
    504                         $conn->message.= "Tried CRAM-MD5: $result \n"; 
     507             
     508                        $conn->message .= "Tried CRAM-MD5: $result \n"; 
    505509                } else { 
    506                         $conn->message.='No challenge ('.htmlspecialchars($line)."), try plain\n"; 
    507                         $auth = "plain"; 
     510                        $conn->message .='No challenge ('.htmlspecialchars($line)."), try plain\n"; 
     511                         
     512            $auth = 'plain';             
    508513                } 
    509514        } 
Note: See TracChangeset for help on using the changeset viewer.