aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-25 20:34:21 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-25 20:34:21 +0100
commit77dcd4c0c5a727fa4f709375a806ba11cf0c919f (patch)
tree7da22ff31bda60b709d93a15b896c8cfdcaaeb89 /core/stanza_router.lua
parent599efdf60dd8ccd902cd1d3501a38df0ed0baef8 (diff)
downloadprosody-77dcd4c0c5a727fa4f709375a806ba11cf0c919f.tar.gz
prosody-77dcd4c0c5a727fa4f709375a806ba11cf0c919f.zip
Log when an incoming dialback verification request is an invalid key for our domain
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 73924d9c..44c2a82b 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -114,9 +114,12 @@ function core_handle_stanza(origin, stanza)
print(tostring(origin.to_host), tostring(origin.from_host))
-- FIXME: 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 = "invalid";
+ local type;
if s2s_verify_dialback(attr.id, attr.from, attr.to, stanza[1]) then
type = "valid"
+ else
+ type = "invalid"
+ log("warn", "Asked to verify a dialback key that was incorrect. An imposter is claiming to be %s?", attr.to);
end
origin.send(format("<db:verify from='%s' to='%s' id='%s' type='%s'>%s</db:verify>", attr.to, attr.from, attr.id, type, stanza[1]));
elseif stanza.name == "result" and origin.type == "s2sin_unauthed" then