# HG changeset patch # User Tobias Markmann # Date 1250711956 -7200 # Node ID 1dcfb2c6430214ab552bafbe7593bc6294d727e8 # Parent c34409a5fdee90b6469973817f26056896f63306 Use NODEprep for prepping usernames used during SASL logins. diff -r c34409a5fdee -r 1dcfb2c64302 plugins/mod_saslauth.lua --- a/plugins/mod_saslauth.lua Wed Aug 19 21:34:28 2009 +0200 +++ b/plugins/mod_saslauth.lua Wed Aug 19 21:59:16 2009 +0200 @@ -12,7 +12,7 @@ local sm_bind_resource = require "core.sessionmanager".bind_resource; local sm_make_authenticated = require "core.sessionmanager".make_authenticated; local base64 = require "util.encodings".base64; - +local nodeprep = require "util.encodings".stringprep.nodeprep; local datamanager_load = require "util.datamanager".load; local usermanager_validate_credentials = require "core.usermanager".validate_credentials; local t_concat, t_insert = table.concat, table.insert; @@ -65,8 +65,12 @@ end local function password_callback(node, hostname, realm, mechanism, decoder) + local func = function(x) return x; end; + local node = nodeprep(node); + if not node then + return func, nil; + end local password = (datamanager_load(node, hostname, "accounts") or {}).password; -- FIXME handle hashed passwords - local func = function(x) return x; end; if password then if mechanism == "PLAIN" then return func, password;