Skip to content

Commit 000e6fc

Browse files
committed
SCRAM-SHA-1(-PLUS) + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) supports pear#57
1 parent e03e645 commit 000e6fc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Net/SMTP.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,7 @@ protected function authDigestMD5($uid, $pwd, $authz = '')
796796
return $error;
797797
}
798798

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

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

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

1217-
$auth_sasl = new Auth_SASL;
1218-
$cram = $auth_sasl->factory($this->scram_sha_hash_algorithm);
1215+
$cram = Auth_SASL::factory($this->scram_sha_hash_algorithm);
12191216
$auth_str = base64_encode($cram->getResponse($uid, $pwd));
12201217

12211218
/* Step 1: Send first authentication request */

0 commit comments

Comments
 (0)