[Tkabber-dev] r757 - in trunk/tkabber: . jabberlib-tclxml

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Oct 11 09:41:02 MSD 2006


Author: sergei
Date: 2006-10-11 09:40:58 +0400 (Wed, 11 Oct 2006)
New Revision: 757

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/jabberlib-tclxml/jlibsasl.tcl
Log:
	* jabberlib-tclxml/jlibsasl.tcl: Added support of X-GOOGLE-TOKEN
	  authentication mechanism, which implemented in tcllib 1.9 SASL
	  module.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-10-10 19:29:22 UTC (rev 756)
+++ trunk/tkabber/ChangeLog	2006-10-11 05:40:58 UTC (rev 757)
@@ -1,5 +1,9 @@
 2006-10-11  Sergei Golovan  <sgolovan at nes.ru>
 
+	* jabberlib-tclxml/jlibsasl.tcl: Added support of X-GOOGLE-TOKEN
+	  authentication mechanism, which implemented in tcllib 1.9 SASL
+	  module.
+
 	* utils.tcl: Added another workaround for XIM input.
 
 	* plugins/unix/ispell.tcl: Use workaround from utils.tcl.

Modified: trunk/tkabber/jabberlib-tclxml/jlibsasl.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/jlibsasl.tcl	2006-10-10 19:29:22 UTC (rev 756)
+++ trunk/tkabber/jabberlib-tclxml/jlibsasl.tcl	2006-10-11 05:40:58 UTC (rev 757)
@@ -53,10 +53,11 @@
     variable uid 0
     variable saslpack
 
-    if {![catch { package require sasl 1.0 }]} {
+    if {![catch {package require sasl 1.0}]} {
 	set saslpack tclsasl
-    } elseif {![catch { package require SASL 1.0 }]} {
-	catch { package require SASL::NTLM }
+    } elseif {![catch {package require SASL 1.0}]} {
+	catch {package require SASL::NTLM}
+	catch {package require SASL::XGoogleToken}
 	set saslpack tcllib
     } else {
 	return -code error "No SASL package found"
@@ -100,7 +101,7 @@
 
     set state(-connid) $connid
     set state(-allow_plain) 0
-    catch { unset state(-mechanisms) }
+    catch {unset state(-mechanisms)}
 
     proc $token {cmd args} \
 	"eval {[namespace current]::\$cmd} {$token} \$args"
@@ -135,8 +136,8 @@
 	}
     }
 
-    catch { unset state }
-    catch { rename $token "" }
+    catch {unset state}
+    catch {rename $token ""}
 }
 
 ##########################################################################
@@ -302,18 +303,16 @@
 	    } result]
 	}
 	tcllib {
-	    set code [catch { choose_mech $token } result]
+	    set code [catch {choose_mech $token} result]
 
 	    if {!$code} {
 		set mech $result
 		SASL::configure $state(-token) -mech $mech
 		switch -- $mech {
-		    PLAIN {
+		    PLAIN -
+		    X-GOOGLE-TOKEN {
 			# Initial responce
-			set code \
-			    [catch {SASL::step $state(-token) ""} \
-				 result]
-
+			set code [catch {SASL::step $state(-token) ""} result]
 			if {!$code} {
 			    set output [SASL::response $state(-token)]
 			}
@@ -392,7 +391,7 @@
 	    } result]
 	}
 	tcllib {
-	    set code [catch { SASL::step $state(-token) $serverin } result]
+	    set code [catch {SASL::step $state(-token) $serverin} result]
 
 	    if {!$code} {
 		set result [SASL::response $state(-token)]



More information about the Tkabber-dev mailing list