From ea7181e5b2bf2a34e9af9919fb34e448ea9cf1af Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Wed, 1 Jul 2009 15:14:44 +0200 Subject: Making sure the node is in unicode when passing it to password lookup function. --- plugins/mod_saslauth.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 02ba41cf..754c82b3 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -12,6 +12,7 @@ local st = require "util.stanza"; 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 to_unicode = require "util.encodings".idna.to_unicode; local datamanager_load = require "util.datamanager".load; local usermanager_validate_credentials = require "core.usermanager".validate_credentials; @@ -65,7 +66,7 @@ local function handle_status(session, status) end local function password_callback(node, hostname, realm, mechanism, decoder) - local password = (datamanager_load(node, hostname, "accounts") or {}).password; -- FIXME handle hashed passwords + local password = (datamanager_load(node, to_unicode(hostname), "accounts") or {}).password; -- FIXME handle hashed passwords local func = function(x) return x; end; if password then if mechanism == "PLAIN" then -- cgit v1.2.3 From 3dc21c4fc7da90b0ef739a85351c91ab87a38148 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 1 Jul 2009 17:53:18 +0100 Subject: Send xml:lang in stream headers, fixes #78 --- core/s2smanager.lua | 2 +- core/sessionmanager.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 879084d8..63605d5e 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -253,7 +253,7 @@ function try_connect(host_session, connect_host, connect_port) local w = conn.write; host_session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end - conn.write(format([[]], from_host, to_host)); + conn.write(format([[]], from_host, to_host)); log("debug", "Connection attempt in progress..."); return true; end diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 2862cd52..24da7c83 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -165,7 +165,7 @@ function streamopened(session, attr) (session.log or session)("debug", "Client sent opening to %s", session.host); send(""); - send(format("", session.streamid, session.host)); + send(format("", session.streamid, session.host)); if not hosts[session.host] then -- We don't serve this host... -- cgit v1.2.3