X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;ds=sidebyside;f=util%2Fsasl.lua;h=b91e29a6cd51c4c8da4b54e8e4fec318f4c20488;hb=981defd6f76f004f55ec673ff4914b0802682e3c;hp=2eb52c1d10cbd80fb64dc531cdaf90deb8f8aef0;hpb=1e8a348576fd217c463bb954fc493f37eea93c89;p=prosody.git diff --git a/util/sasl.lua b/util/sasl.lua index 2eb52c1d..b91e29a6 100644 --- a/util/sasl.lua +++ b/util/sasl.lua @@ -18,7 +18,6 @@ local type = type local setmetatable = setmetatable; local assert = assert; local require = require; -local print = print module "sasl" @@ -101,14 +100,16 @@ end 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