From 07f5140771388c9e0c8a99b0dd2e5d950bdb173b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 14 Oct 2021 15:16:42 +1100 Subject: moving h-source subdir out. --- .../Transport/Esmtp/Auth/CramMd5Authenticator.php | 88 ---------------------- 1 file changed, 88 deletions(-) delete mode 100755 h-source/External/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php (limited to 'h-source/External/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php') diff --git a/h-source/External/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php b/h-source/External/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php deleted file mode 100755 index 4c7e0f2..0000000 --- a/h-source/External/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php +++ /dev/null @@ -1,88 +0,0 @@ -executeCommand("AUTH CRAM-MD5\r\n", array(334)); - $challenge = base64_decode(substr($challenge, 4)); - $message = base64_encode( - $username . ' ' . $this->_getResponse($password, $challenge) - ); - $agent->executeCommand(sprintf("%s\r\n", $message), array(235)); - return true; - } - catch (Swift_TransportException $e) - { - $agent->executeCommand("RSET\r\n", array(250)); - return false; - } - } - - /** - * Generate a CRAM-MD5 response from a server challenge. - * @param string $secret - * @param string $challenge - * @return string - */ - private function _getResponse($secret, $challenge) - { - if (strlen($secret) > 64) - { - $secret = pack('H32', md5($secret)); - } - - if (strlen($secret) < 64) - { - $secret = str_pad($secret, 64, chr(0)); - } - - $k_ipad = substr($secret, 0, 64) ^ str_repeat(chr(0x36), 64); - $k_opad = substr($secret, 0, 64) ^ str_repeat(chr(0x5C), 64); - - $inner = pack('H32', md5($k_ipad . $challenge)); - $digest = md5($k_opad . $inner); - - return $digest; - } - -} -- cgit v1.2.3