aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-03-22 14:45:04 +0100
committerKim Alvefur <zash@zash.se>2014-03-22 14:45:04 +0100
commitadd9033b9b25362ebce1f91a32b4911e66ff8452 (patch)
tree6254e4ab4822abedbda387f7af5dbafed3c2e6cd /util/sasl.lua
parent9ea9c5719a2275b3ae66378619cef64a392a1fec (diff)
downloadprosody-add9033b9b25362ebce1f91a32b4911e66ff8452.tar.gz
prosody-add9033b9b25362ebce1f91a32b4911e66ff8452.zip
util.sasl: Fix logic for when mechanisms with channel binding support are offered
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index c8490842..b91e29a6 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -100,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