[Tkabber-dev] [tclxmpp commit] r99 - * xmpp/https.tcl, xmpp/ntlm.tcl, xmpp/pkgIndex.tcl: Removed redundant

codesite-noreply at google.com codesite-noreply at google.com
Mon Mar 30 21:43:42 MSD 2009


Author: sgolovan
Date: Mon Mar 30 10:16:17 2009
New Revision: 99

Removed:
    trunk/xmpp/ntlm.tcl
Modified:
    trunk/ChangeLog
    trunk/xmpp/https.tcl
    trunk/xmpp/pkgIndex.tcl

Log:
	* xmpp/https.tcl, xmpp/ntlm.tcl, xmpp/pkgIndex.tcl: Removed redundant
	  ntlm package and switched to SASL::NTLM for NTLM authentication at
	  an HTTPS proxy server.


Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Mon Mar 30 10:16:17 2009
@@ -3,6 +3,10 @@
  	* xmpp/poll.tcl: Do not send Proxy-Authorization header if username
  	  and password are empty.

+	* xmpp/https.tcl, xmpp/ntlm.tcl, xmpp/pkgIndex.tcl: Removed redundant
+	  ntlm package and switched to SASL::NTLM for NTLM authentication at
+	  an HTTPS proxy server.
+
  2009-03-29  Sergei Golovan  <sgolovan at nes.ru>

  	* xmpp/pconnect.tcl, xmpp/https.tcl, xmpp/socks4.tcl, xmpp/socks5.tcl:

Modified: trunk/xmpp/https.tcl
==============================================================================
--- trunk/xmpp/https.tcl	(original)
+++ trunk/xmpp/https.tcl	Mon Mar 30 10:16:17 2009
@@ -12,7 +12,7 @@
  # $Id$

  package require base64
-package require ntlm 1.0
+package require SASL::NTLM 1.0
  package require pconnect 0.1
  package require msgcat

@@ -340,12 +340,7 @@
      set username $state(-username)
      regexp {(\w+)[\\/](.*)} $username -> domain username

-    set ntlmtok [NTLM::new -domain $domain \
-                           -host $host \
-                           -username $username \
-                           -password $state(-password)]
-    set message1 [$ntlmtok type1Message]
-    set state(ntlmtok) $ntlmtok
+    set message1 [::SASL::NTLM::CreateGreeting $domain $host]

      PutsConnectQuery $token "NTLM $message1"

@@ -408,9 +403,19 @@

      ReadProxyJunk $token $content_length

-    $state(ntlmtok) parseType2Message -message $message2
-    set message3 [$state(ntlmtok) type3Message]
+    array set challenge [::SASL::NTLM::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)]
      PutsConnectQuery $token "NTLM $message3"

      fileevent $state(sock) readable \
@@ -623,7 +628,6 @@
      variable $token
      upvar 0 $token state

-    catch {$state(ntlmtok) free}
      catch {after cancel $state(timeoutid)}
      catch {unset state}
      return

Modified: trunk/xmpp/pkgIndex.tcl
==============================================================================
--- trunk/xmpp/pkgIndex.tcl	(original)
+++ trunk/xmpp/pkgIndex.tcl	Mon Mar 30 10:16:17 2009
@@ -10,7 +10,6 @@
  #
  # $Id$

-package ifneeded ntlm 1.0                       [list source [file join  
$dir ntlm.tcl]]
  package ifneeded pconnect 0.1                   [list source [file join  
$dir pconnect.tcl]]
  package ifneeded pconnect::https 0.1            [list source [file join  
$dir https.tcl]]
  package ifneeded pconnect::socks4 0.1           [list source [file join  
$dir socks4.tcl]]


More information about the Tkabber-dev mailing list