aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-11-13 09:21:19 +0100
committerTobias Markmann <tm@ayena.de>2009-11-13 09:21:19 +0100
commit72e185fa03df69754ea24322db832e85b015c379 (patch)
tree9abc5390704f485e33f71fba614f7f7a55cfb08e
parentMove each mechanism in an own file. (diff)
downloadprosody-72e185fa03df69754ea24322db832e85b015c379.tar.xz
prosody-72e185fa03df69754ea24322db832e85b015c379.zip
Getting PLAIN mechanism work with the new API.
-rw-r--r--util/sasl.lua9
-rw-r--r--util/sasl/plain.lua6
2 files changed, 10 insertions, 5 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 94ed3ac98..e9b466ee4 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -30,6 +30,8 @@ local error = error
local print = print
local setmetatable = setmetatable;
local assert = assert;
+local dofile = dofile;
+local require = require;
require "util.iterators"
local keys = keys
@@ -120,8 +122,9 @@ function method:process(message)
end
-- load the mechanisms
-require "sasl.plain"
-require "sasl.digest-md5"
-require "sasl.scram"
+m = require "util.sasl.plain"
+m.init(registerMechanism)
+--dofile "util/sasl/digest-md5.lua"
+--dofile "util/sasl/scram.lua"
return _M;
diff --git a/util/sasl/plain.lua b/util/sasl/plain.lua
index 898657f02..080560539 100644
--- a/util/sasl/plain.lua
+++ b/util/sasl/plain.lua
@@ -11,7 +11,7 @@
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-local registerMechanism = registerMechanism
+local s_match = string.match;
module "plain"
@@ -48,6 +48,8 @@ local function plain(self, message)
end
end
-registerMechanism("PLAIN", {"plain", "plain_test"}, plain);
+function init(registerMechanism)
+ registerMechanism("PLAIN", {"plain", "plain_test"}, plain);
+end
return _M; \ No newline at end of file