aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2011-01-17 16:50:21 +0100
committerTobias Markmann <tm@ayena.de>2011-01-17 16:50:21 +0100
commit0435f611fd9e7794b8f42699c35ceee01dd28d1f (patch)
tree4b0bbad4ed0d5316e291ad10b9f2c30be41377c3 /util/sasl.lua
parent1fbe88e5c40b9a48ea35aedaaaee9152991b8e65 (diff)
downloadprosody-0435f611fd9e7794b8f42699c35ceee01dd28d1f.tar.gz
prosody-0435f611fd9e7794b8f42699c35ceee01dd28d1f.zip
util.sasl: New method to add channel binding handler to a SASL instance.
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 37a234c9..cd0a1d64 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -70,6 +70,15 @@ function new(realm, profile)
return setmetatable({ profile = profile, realm = realm, mechs = mechanisms }, method);
end
+-- add a channel binding handler
+function method:add_cb_handler(name, f)
+ if type(self.profile.cb) ~= "table" then
+ self.profile.cb = {};
+ end
+ self.profile.cb[name] = f;
+ return self;
+end
+
-- get a fresh clone with the same realm and profile
function method:clean_clone()
return new(self.realm, self.profile)