Mercurial > prosody-hg
comparison plugins/mod_saslauth.lua @ 4506:6643c9753453
mod_saslauth: Remove useless import of, and call to nodeprep.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 12 Feb 2012 15:14:35 +0100 |
| parents | b1e10c327d66 |
| children | 449a78f91f0e |
comparison
equal
deleted
inserted
replaced
| 4505:b1e10c327d66 | 4506:6643c9753453 |
|---|---|
| 14 local s2s_make_authenticated = require "core.s2smanager".make_authenticated; | 14 local s2s_make_authenticated = require "core.s2smanager".make_authenticated; |
| 15 local base64 = require "util.encodings".base64; | 15 local base64 = require "util.encodings".base64; |
| 16 | 16 |
| 17 local cert_verify_identity = require "util.x509".verify_identity; | 17 local cert_verify_identity = require "util.x509".verify_identity; |
| 18 | 18 |
| 19 local nodeprep = require "util.encodings".stringprep.nodeprep; | |
| 20 local usermanager_get_sasl_handler = require "core.usermanager".get_sasl_handler; | 19 local usermanager_get_sasl_handler = require "core.usermanager".get_sasl_handler; |
| 21 local tostring = tostring; | 20 local tostring = tostring; |
| 22 | 21 |
| 23 local secure_auth_only = module:get_option("c2s_require_encryption") or module:get_option("require_encryption"); | 22 local secure_auth_only = module:get_option("c2s_require_encryption") or module:get_option("require_encryption"); |
| 24 local allow_unencrypted_plain_auth = module:get_option("allow_unencrypted_plain_auth") | 23 local allow_unencrypted_plain_auth = module:get_option("allow_unencrypted_plain_auth") |
| 49 local function handle_status(session, status, ret, err_msg) | 48 local function handle_status(session, status, ret, err_msg) |
| 50 if status == "failure" then | 49 if status == "failure" then |
| 51 module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg }); | 50 module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg }); |
| 52 session.sasl_handler = session.sasl_handler:clean_clone(); | 51 session.sasl_handler = session.sasl_handler:clean_clone(); |
| 53 elseif status == "success" then | 52 elseif status == "success" then |
| 54 local username = nodeprep(session.sasl_handler.username); | |
| 55 | |
| 56 local ok, err = sm_make_authenticated(session, session.sasl_handler.username); | 53 local ok, err = sm_make_authenticated(session, session.sasl_handler.username); |
| 57 if ok then | 54 if ok then |
| 58 module:fire_event("authentication-success", { session = session }); | 55 module:fire_event("authentication-success", { session = session }); |
| 59 session.sasl_handler = nil; | 56 session.sasl_handler = nil; |
| 60 session:reset_stream(); | 57 session:reset_stream(); |
