Check whether we support the proposed channel binding type.
--- a/util/sasl.lua Wed Jan 12 21:29:37 2011 +0100
+++ b/util/sasl.lua Sat Jan 15 17:59:15 2011 +0100
@@ -27,6 +27,17 @@
state = false : disabled
state = true : enabled
state = nil : non-existant
+
+Channel Binding:
+
+To enable support of channel binding in some mechanisms you need to provide appropriate callbacks in a table
+at profile.cb.
+
+Example:
+ profile.cb["tls-unique"] = function(self)
+ return self.user
+ end
+
]]
local method = {};
--- a/util/sasl/scram.lua Wed Jan 12 21:29:37 2011 +0100
+++ b/util/sasl/scram.lua Sat Jan 15 17:59:15 2011 +0100
@@ -137,6 +137,11 @@
if string.sub(self.state.gs2_cbind_flag, 0, 1) == "y" then
return "failure", "malformed-request";
end
+
+ -- check whether we support the proposed channel binding type
+ if not self.profile.cb[self.state.gs2_cbind_name] then
+ return "failure", "malformed-request", "Proposed channel binding type isn't supported.";
+ end
else
if self.state.gs2_cbind_flag ~= "n" and self.state.gs2_cbind_flag ~= "y" then
return "failure", "malformed-request";