diff options
-rw-r--r-- | core/s2smanager.lua | 7 | ||||
-rw-r--r-- | core/stanza_router.lua | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua index ba14f2fe..0f27655f 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -111,11 +111,6 @@ function streamopened(session, attr) print(session, session.from_host, "incoming s2s stream opened"); send("<?xml version='1.0'?>"); send(format("<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s'>", session.streamid, session.to_host)); - if session.from_host then - -- Need to perform dialback to check identity - print("to: "..tostring(attr.to).." from: "..tostring(attr.from)); - print("Need to do dialback here you know!!"); - end elseif session.direction == "outgoing" then -- If we are just using the connection for verifying dialback keys, we won't try and auth it if not session.dialback_verifying then @@ -180,7 +175,7 @@ function mark_connected(session) end function destroy_session(session) - (session.log or log)("info", "Destroying session"); + (session.log or log)("info", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host)); if session.direction == "outgoing" then hosts[session.to_host] = nil; end diff --git a/core/stanza_router.lua b/core/stanza_router.lua index d63dfaf3..dfb91ee3 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -135,9 +135,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 |