Skip to content

Commit

Permalink
Merge branch 'master' of github.com:roundcube/Net_Sieve
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Mar 9, 2017
2 parents 89749d0 + 114dcd7 commit fe5ebbb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sieve.php
Expand Up @@ -699,9 +699,11 @@ function _authCRAMMD5($user, $pass, $euser)
return $challenge;
}

$auth_sasl = new Auth_SASL;
$cram = $auth_sasl->factory('crammd5');
$challenge = base64_decode(trim($challenge));
$cram = Auth_SASL::factory('crammd5');
$response = $cram->getResponse($user, $pass, $challenge);
$response = $cram->getResponse($user, $pass, $challenge);

if (is_a($response, 'PEAR_Error')) {
return $response;
}
Expand All @@ -725,8 +727,10 @@ function _authDigestMD5($user, $pass, $euser)
return $challenge;
}

$auth_sasl = new Auth_SASL;
$digest = $auth_sasl->factory('digestmd5');
$challenge = base64_decode(trim($challenge));
$digest = Auth_SASL::factory('digestmd5');

// @todo Really 'localhost'?
$response = $digest->getResponse($user, $pass, $challenge, 'localhost', 'sieve', $euser);
if (is_a($response, 'PEAR_Error')) {
Expand Down

0 comments on commit fe5ebbb

Please sign in to comment.