From d1a89e8f9c898545d2ef3c9c3e8740a04f19628b Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 15 Jun 2012 02:53:57 +0500 Subject: mod_dialback: Skip an unnecessary nameprep. --- plugins/mod_dialback.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_dialback.lua') diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua index 2299c0dc..67be15e3 100644 --- a/plugins/mod_dialback.lua +++ b/plugins/mod_dialback.lua @@ -84,7 +84,7 @@ module:hook("stanza/jabber:server:dialback:result", function(event) origin.from_host = from; end if not origin.to_host then - origin.to_host = nameprep(attr.to); + origin.to_host = to; end origin.log("debug", "asking %s if key %s belongs to them", from, stanza[1]); -- cgit v1.2.3 From e89b006f03f692a7e807c54757f0623302c40b85 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 23 Jul 2012 17:32:33 +0100 Subject: Hopefully inert commit to clean up logging across a number of modules, removing all cases of concatenation when building log messages --- plugins/mod_dialback.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins/mod_dialback.lua') diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua index 67be15e3..73a799e9 100644 --- a/plugins/mod_dialback.lua +++ b/plugins/mod_dialback.lua @@ -102,7 +102,6 @@ module:hook("stanza/jabber:server:dialback:verify", function(event) if origin.type == "s2sout_unauthed" or origin.type == "s2sout" then local attr = stanza.attr; local dialback_verifying = dialback_requests[attr.from.."/"..(attr.id or "")]; - module:log("debug", tostring(dialback_verifying).." "..attr.from.." "..origin.to_host); if dialback_verifying and attr.from == origin.to_host then local valid; if attr.type == "valid" then @@ -110,7 +109,7 @@ module:hook("stanza/jabber:server:dialback:verify", function(event) valid = "valid"; else -- Warn the original connection that is was not verified successfully - log("warn", "authoritative server for "..(attr.from or "(unknown)").." denied the key"); + log("warn", "authoritative server for %s denied the key", attr.from or "(unknown)"); valid = "invalid"; end if not dialback_verifying.sends2s then -- cgit v1.2.3 From 47619af14cd24fcb48b4d2b4c4653f72b882087e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 27 Jul 2012 20:29:32 +0100 Subject: mod_dialback: Ignore with a 'type' attribute on incoming connections, instead of interpreting them as a request to verify a key --- plugins/mod_dialback.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/mod_dialback.lua') diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua index 73a799e9..69616a57 100644 --- a/plugins/mod_dialback.lua +++ b/plugins/mod_dialback.lua @@ -41,6 +41,11 @@ module:hook("stanza/jabber:server:dialback:verify", function(event) -- We are being asked to verify the key, to ensure it was generated by us origin.log("debug", "verifying that dialback key is ours..."); local attr = stanza.attr; + if attr.type then + module:log("warn", "Ignoring incoming session from %s claiming a dialback key for %s is %s", + origin.from_host or "(unknown)", attr.from or "(unknown)", attr.type); + return true; + end -- COMPAT: Grr, ejabberd breaks this one too?? it is black and white in XEP-220 example 34 --if attr.from ~= origin.to_host then error("invalid-from"); end local type; -- cgit v1.2.3