Log when an incoming dialback verification request is an invalid key for our domain
authorMatthew Wild <mwild1@gmail.com>
Sat, 25 Oct 2008 19:34:21 +0000 (20:34 +0100)
committerMatthew Wild <mwild1@gmail.com>
Sat, 25 Oct 2008 19:34:21 +0000 (20:34 +0100)
core/stanza_router.lua

index 73924d9cba32c82474b077701cf943d70a2177e2..44c2a82bfe5c9e14fe29df403a2d14af870c6b85 100644 (file)
@@ -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