[Tkabber-dev] [tclxmpp commit] r102 - * xmpp/https.tcl: Fixed proxy NTLM authentication.

codesite-noreply at google.com codesite-noreply at google.com
Fri Apr 3 13:48:17 MSD 2009


Author: sgolovan
Date: Fri Apr  3 02:07:14 2009
New Revision: 102

Modified:
    trunk/ChangeLog
    trunk/xmpp/https.tcl

Log:
	* xmpp/https.tcl: Fixed proxy NTLM authentication.


Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Fri Apr  3 02:07:14 2009
@@ -1,3 +1,7 @@
+2009-04-03  Sergei Golovan  <sgolovan at nes.ru>
+
+	* xmpp/https.tcl: Fixed proxy NTLM authentication.
+
  2009-03-31  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/sasl.tcl: Took into account that MD5-DIGEST SASL mechanism in

Modified: trunk/xmpp/https.tcl
==============================================================================
--- trunk/xmpp/https.tcl	(original)
+++ trunk/xmpp/https.tcl	Fri Apr  3 02:07:14 2009
@@ -340,7 +340,9 @@
      set username $state(-username)
      regexp {(\w+)[\\/](.*)} $username -> domain username

-    set message1 [::SASL::NTLM::CreateGreeting $domain $host]
+    set message1 \
+        [string map {\n {}} \
+                [base64::encode [::SASL::NTLM::CreateGreeting $domain  
$host]]]

      PutsConnectQuery $token "NTLM $message1"

@@ -403,19 +405,22 @@

      ReadProxyJunk $token $content_length

-    array set challenge [::SASL::NTLM::Decode $message2]
+    array set challenge [::SASL::NTLM::Decode [base64::decode $message2]]

      # if username is domain/username or domain\username
      # then set domain and username
      set username $state(-username)
      regexp {(\w+)[\\/](.*)} $username -> domain username

-    set message3 [::SASL::NTLM::CreateResponse $challenge(domain) \
-                                               [info hostname]    \
-                                               $username          \
-                                               $state(-password)  \
-                                               $challenge(nonce)  \
-                                               $challenge(flags)]
+    set message3 \
+        [string map {\n {}} \
+                [base64::encode \
+                        [::SASL::NTLM::CreateResponse $challenge(domain) \
+                                                      [info hostname]    \
+                                                      $username          \
+                                                      $state(-password)  \
+                                                      $challenge(nonce)  \
+                                                      $challenge(flags)]]]
      PutsConnectQuery $token "NTLM $message3"

      fileevent $state(sock) readable \


More information about the Tkabber-dev mailing list