Comparison

util/sasl.lua @ 6036:f9e108f7db21

util.sasl: Fix logic for when mechanisms with channel binding support are offered
author Kim Alvefur <zash@zash.se>
date Sat, 22 Mar 2014 14:45:04 +0100
parent 5863:abcbaf7f2e8e
child 6777:5de6b93d0190
comparison
equal deleted inserted replaced
6031:8796aa94c4b5 6036:f9e108f7db21
98 98
99 -- get a list of possible SASL mechanims to use 99 -- get a list of possible SASL mechanims to use
100 function method:mechanisms() 100 function method:mechanisms()
101 local current_mechs = {}; 101 local current_mechs = {};
102 for mech, _ in pairs(self.mechs) do 102 for mech, _ in pairs(self.mechs) do
103 if mechanism_channelbindings[mech] and self.profile.cb then 103 if mechanism_channelbindings[mech] then
104 local ok = false; 104 if self.profile.cb then
105 for cb_name, _ in pairs(self.profile.cb) do 105 local ok = false;
106 if mechanism_channelbindings[mech][cb_name] then 106 for cb_name, _ in pairs(self.profile.cb) do
107 ok = true; 107 if mechanism_channelbindings[mech][cb_name] then
108 ok = true;
109 end
108 end 110 end
111 if ok == true then current_mechs[mech] = true; end
109 end 112 end
110 if ok == true then current_mechs[mech] = true; end
111 else 113 else
112 current_mechs[mech] = true; 114 current_mechs[mech] = true;
113 end 115 end
114 end 116 end
115 return current_mechs; 117 return current_mechs;