util/sasl.lua
changeset 6036 f9e108f7db21
parent 5863 abcbaf7f2e8e
child 6780 5de6b93d0190
--- a/util/sasl.lua	Sun Mar 09 23:47:53 2014 +0100
+++ b/util/sasl.lua	Sat Mar 22 14:45:04 2014 +0100
@@ -100,14 +100,16 @@
 function method:mechanisms()
 	local current_mechs = {};
 	for mech, _ in pairs(self.mechs) do
-		if mechanism_channelbindings[mech] and self.profile.cb then
-			local ok = false;
-			for cb_name, _ in pairs(self.profile.cb) do
-				if mechanism_channelbindings[mech][cb_name] then
-					ok = true;
+		if mechanism_channelbindings[mech] then
+			if self.profile.cb then
+				local ok = false;
+				for cb_name, _ in pairs(self.profile.cb) do
+					if mechanism_channelbindings[mech][cb_name] then
+						ok = true;
+					end
 				end
+				if ok == true then current_mechs[mech] = true; end
 			end
-			if ok == true then current_mechs[mech] = true; end
 		else
 			current_mechs[mech] = true;
 		end