# HG changeset patch # User Tobias Markmann # Date 1258100479 -3600 # Node ID f0a85d11823eb51f6d5861614b698c7a7fa24bdc # Parent 1112871916eb1ac6c1adcf8b9af061eb738490fc Getting PLAIN mechanism work with the new API. diff -r 1112871916eb -r f0a85d11823e util/sasl.lua --- a/util/sasl.lua Thu Nov 12 21:57:37 2009 +0100 +++ b/util/sasl.lua Fri Nov 13 09:21:19 2009 +0100 @@ -30,6 +30,8 @@ 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 @@ 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 -r 1112871916eb -r f0a85d11823e util/sasl/plain.lua --- a/util/sasl/plain.lua Thu Nov 12 21:57:37 2009 +0100 +++ b/util/sasl/plain.lua Fri Nov 13 09:21:19 2009 +0100 @@ -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 @@ 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