Skip to content

Commit

Permalink
SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) supp…
Browse files Browse the repository at this point in the history
…orts pear#57
  • Loading branch information
schengawegga committed Aug 18, 2023
1 parent e03e645 commit 000e6fc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Net/SMTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,7 @@ protected function authDigestMD5($uid, $pwd, $authz = '')
return $error;
}

$auth_sasl = new Auth_SASL;
$digest = $auth_sasl->factory('digest-md5');
$digest = Auth_SASL::factory('digest-md5');
$challenge = base64_decode($this->arguments[0]);
$auth_str = base64_encode(
$digest->getResponse($uid, $pwd, $challenge, $this->host, "smtp", $authz)
Expand Down Expand Up @@ -852,9 +851,8 @@ protected function authCRAMMD5($uid, $pwd, $authz = '')
return $error;
}

$auth_sasl = new Auth_SASL;
$challenge = base64_decode($this->arguments[0]);
$cram = $auth_sasl->factory('cram-md5');
$cram = Auth_SASL::factory('cram-md5');
$auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge));

if (PEAR::isError($error = $this->put($auth_str))) {
Expand Down Expand Up @@ -1214,8 +1212,7 @@ protected function authScramSHA($uid, $pwd, $authz = '')
return $error;
}

$auth_sasl = new Auth_SASL;
$cram = $auth_sasl->factory($this->scram_sha_hash_algorithm);
$cram = Auth_SASL::factory($this->scram_sha_hash_algorithm);
$auth_str = base64_encode($cram->getResponse($uid, $pwd));

/* Step 1: Send first authentication request */
Expand Down

0 comments on commit 000e6fc

Please sign in to comment.