aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-11-13 10:54:17 +0100
committerTobias Markmann <tm@ayena.de>2009-11-13 10:54:17 +0100
commited841d20a7881697a28a5497067df53f128348e3 (patch)
treecc58219c6d0b4912b0105235a1dc01068db40e79 /util/sasl.lua
parent72e185fa03df69754ea24322db832e85b015c379 (diff)
downloadprosody-ed841d20a7881697a28a5497067df53f128348e3.tar.gz
prosody-ed841d20a7881697a28a5497067df53f128348e3.zip
Add support for plain profile in digest-md5 implementation.
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua18
1 files changed, 11 insertions, 7 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index e9b466ee..8fe4727e 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -16,10 +16,8 @@ local md5 = require "util.hashes".md5;
local log = require "util.logger".init("sasl");
local tostring = tostring;
local st = require "util.stanza";
-local generate_uuid = require "util.uuid".generate;
local pairs, ipairs = pairs, ipairs;
local t_insert, t_concat = table.insert, table.concat;
-local to_byte, to_char = string.byte, string.char;
local to_unicode = require "util.encodings".idna.to_unicode;
local s_match = string.match;
local gmatch = string.gmatch
@@ -42,6 +40,10 @@ module "sasl"
--[[
Authentication Backend Prototypes:
+state = false : disabled
+state = true : enabled
+state = nil : non-existant
+
plain:
function(username, realm)
return password, state;
@@ -117,14 +119,16 @@ end
-- feed new messages to process into the library
function method:process(message)
- if message == "" or message == nil then return "failure", "malformed-request" end
+ --if message == "" or message == nil then return "failure", "malformed-request" end
return self.mech_i(self, message);
end
-- load the mechanisms
-m = require "util.sasl.plain"
-m.init(registerMechanism)
---dofile "util/sasl/digest-md5.lua"
---dofile "util/sasl/scram.lua"
+load_mechs = {"plain", "digest-md5"}
+for _, mech in ipairs(load_mechs) do
+ local name = "util.sasl."..mech;
+ local m = require(name);
+ m.init(registerMechanism)
+end
return _M;