Revision: 2133
http://hastymail.svn.sourceforge.net/hastymail/?rev=2133&view=rev
Author: sailfrog
Date: 2012-12-10 16:01:40 +0000 (Mon, 10 Dec 2012)
Log Message:
-----------
fix NTLM type one message to use minimal fields and be correctly
generated
Modified Paths:
--------------
trunk/hastymail2/lib/smtp_class.php
Modified: trunk/hastymail2/lib/smtp_class.php
===================================================================
--- trunk/hastymail2/lib/smtp_class.php 2012-12-10 15:09:15 UTC (rev 2132)
+++ trunk/hastymail2/lib/smtp_class.php 2012-12-10 16:01:40 UTC (rev 2133)
@@ -373,7 +373,7 @@
}
break;
case 'ntlm':
- $command = 'AUTH NTLM TlRMTVNTUAABAAAABzIAAAYABgArAAAACwALACAAAABXT1JLU1RBVElPTkRPTUFJTg==';
+ $command = 'AUTH NTLM '.$this->build_ntlm_type_one();
$this->send_command($command);
$response = $this->get_response();
if (empty($response) || !isset($response[0][1][0]) || $this->compare_response($response,'334') != 0) {
@@ -449,6 +449,13 @@
$res['names'] = $names;
return $res;
}
+ /* build initial NTLM message string */
+ function build_ntlm_type_one() {
+ $pre = 'NTLMSSP'.chr(0);
+ $type = pack('V', 1);
+ $flags = pack('V', 0x00000201);
+ return base64_encode($pre.$type.$flags);
+ }
/* build NTLM challenge response string */
function build_ntlm_type_three($msg_data, $username, $password) {
$username = iconv('UTF-8', 'UTF-16LE', $username);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|