aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-02-14 18:57:50 +0100
committerTobias Markmann <tm@ayena.de>2009-02-14 18:57:50 +0100
commit5affd107f0a6d62ff3be6c5aaa8548b4b2cce4ba (patch)
treebb02e38f93aeac6a7a49b00754eac5aaec215172 /util
parent66155f71aa3d5ebf312b7b699984d0be08f2fdd1 (diff)
downloadprosody-5affd107f0a6d62ff3be6c5aaa8548b4b2cce4ba.tar.gz
prosody-5affd107f0a6d62ff3be6c5aaa8548b4b2cce4ba.zip
Adding inital support for ANONYMOUS mechanism in SASL.
Diffstat (limited to 'util')
-rw-r--r--util/sasl.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 43455909..2af60acd 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -1,4 +1,4 @@
--- sasl.lua v0.2
+-- sasl.lua v0.3
-- Copyright (C) 2008-2009 Tobias Markmann
--
-- All rights reserved.
@@ -235,10 +235,21 @@ local function new_digest_md5(realm, password_handler)
return object
end
+local function new_anonymous(realm, password_handler)
+ local object = { mechanism = "ANONYMOUS", realm = realm, password_handler = password_handler}
+ function object.feed(self, message)
+ return "success"
+ end
+ object["username"] = generate_uuid()
+ return object
+end
+
+
function new(mechanism, realm, password_handler)
local object
if mechanism == "PLAIN" then object = new_plain(realm, password_handler)
elseif mechanism == "DIGEST-MD5" then object = new_digest_md5(realm, password_handler)
+ elseif mechanism == "ANONYMOUS" then object = new_anonymous(realm, password_handler)
else
log("debug", "Unsupported SASL mechanism: "..tostring(mechanism));
return nil