equal
deleted
inserted
replaced
45 method.__index = method; |
45 method.__index = method; |
46 local registered_mechanisms = {}; |
46 local registered_mechanisms = {}; |
47 local backend_mechanism = {}; |
47 local backend_mechanism = {}; |
48 local mechanism_channelbindings = {}; |
48 local mechanism_channelbindings = {}; |
49 |
49 |
50 -- register a new SASL mechanims |
50 -- register a new SASL mechanisms |
51 local function registerMechanism(name, backends, f, cb_backends) |
51 local function registerMechanism(name, backends, f, cb_backends) |
52 assert(type(name) == "string", "Parameter name MUST be a string."); |
52 assert(type(name) == "string", "Parameter name MUST be a string."); |
53 assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table."); |
53 assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table."); |
54 assert(type(f) == "function", "Parameter f MUST be a function."); |
54 assert(type(f) == "function", "Parameter f MUST be a function."); |
55 if cb_backends then assert(type(cb_backends) == "table"); end |
55 if cb_backends then assert(type(cb_backends) == "table"); end |
95 -- get a fresh clone with the same realm and profile |
95 -- get a fresh clone with the same realm and profile |
96 function method:clean_clone() |
96 function method:clean_clone() |
97 return new(self.realm, self.profile) |
97 return new(self.realm, self.profile) |
98 end |
98 end |
99 |
99 |
100 -- get a list of possible SASL mechanims to use |
100 -- get a list of possible SASL mechanisms to use |
101 function method:mechanisms() |
101 function method:mechanisms() |
102 local current_mechs = {}; |
102 local current_mechs = {}; |
103 for mech, _ in pairs(self.mechs) do |
103 for mech, _ in pairs(self.mechs) do |
104 if mechanism_channelbindings[mech] then |
104 if mechanism_channelbindings[mech] then |
105 if self.profile.cb then |
105 if self.profile.cb then |