Software /
code /
prosody
Comparison
util/sasl/digest-md5.lua @ 6777:5de6b93d0190
util.*: Remove use of module() function, make all module functions local and return them in a table at the end
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 21 Feb 2015 10:36:37 +0100 |
parent | 5301:6279caf921f1 |
child | 8555:4f0f5b49bb03 |
comparison
equal
deleted
inserted
replaced
6774:3965662ae091 | 6777:5de6b93d0190 |
---|---|
23 local md5 = require "util.hashes".md5; | 23 local md5 = require "util.hashes".md5; |
24 local log = require "util.logger".init("sasl"); | 24 local log = require "util.logger".init("sasl"); |
25 local generate_uuid = require "util.uuid".generate; | 25 local generate_uuid = require "util.uuid".generate; |
26 local nodeprep = require "util.encodings".stringprep.nodeprep; | 26 local nodeprep = require "util.encodings".stringprep.nodeprep; |
27 | 27 |
28 module "sasl.digest-md5" | 28 local _ENV = nil; |
29 | 29 |
30 --========================= | 30 --========================= |
31 --SASL DIGEST-MD5 according to RFC 2831 | 31 --SASL DIGEST-MD5 according to RFC 2831 |
32 | 32 |
33 --[[ | 33 --[[ |
239 if self.authenticated ~= nil then return "success" | 239 if self.authenticated ~= nil then return "success" |
240 else return "failure", "malformed-request" end | 240 else return "failure", "malformed-request" end |
241 end | 241 end |
242 end | 242 end |
243 | 243 |
244 function init(registerMechanism) | 244 local function init(registerMechanism) |
245 registerMechanism("DIGEST-MD5", {"plain"}, digest); | 245 registerMechanism("DIGEST-MD5", {"plain"}, digest); |
246 end | 246 end |
247 | 247 |
248 return _M; | 248 return { |
249 init = init; | |
250 } |