From 627330f670ad7921044592ca72819f7ee6ed3fa0 Mon Sep 17 00:00:00 2001 From: thomascube Date: Mon, 3 Oct 2005 20:25:31 +0000 Subject: Minor bugfixes and SMTP support --- program/lib/Auth/SASL/CramMD5.php | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 program/lib/Auth/SASL/CramMD5.php (limited to 'program/lib/Auth/SASL/CramMD5.php') diff --git a/program/lib/Auth/SASL/CramMD5.php b/program/lib/Auth/SASL/CramMD5.php new file mode 100755 index 000000000..d3fbf179b --- /dev/null +++ b/program/lib/Auth/SASL/CramMD5.php @@ -0,0 +1,68 @@ + | +// +-----------------------------------------------------------------------+ +// +// $Id$ + +/** +* Implmentation of CRAM-MD5 SASL mechanism +* +* @author Richard Heyes +* @access public +* @version 1.0 +* @package Auth_SASL +*/ + +require_once('Auth/SASL/Common.php'); + +class Auth_SASL_CramMD5 extends Auth_SASL_Common +{ + /** + * Implements the CRAM-MD5 SASL mechanism + * This DOES NOT base64 encode the return value, + * you will need to do that yourself. + * + * @param string $user Username + * @param string $pass Password + * @param string $challenge The challenge supplied by the server. + * this should be already base64_decoded. + * + * @return string The string to pass back to the server, of the form + * " ". This is NOT base64_encoded. + */ + function getResponse($user, $pass, $challenge) + { + return $user . ' ' . $this->_HMAC_MD5($pass, $challenge); + } +} +?> \ No newline at end of file -- cgit v1.2.3