Software /
code /
prosody
Comparison
plugins/mod_dialback.lua @ 5019:017e864b459d
mod_dialback: Ignore <db:verify/> with a 'type' attribute on incoming connections, instead of interpreting them as a request to verify a key
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 27 Jul 2012 20:29:32 +0100 |
parent | 4993:5243b74a4cbb |
child | 5113:3393cab2dd6b |
comparison
equal
deleted
inserted
replaced
5018:eb8211b65e96 | 5019:017e864b459d |
---|---|
39 | 39 |
40 if origin.type == "s2sin_unauthed" or origin.type == "s2sin" then | 40 if origin.type == "s2sin_unauthed" or origin.type == "s2sin" then |
41 -- We are being asked to verify the key, to ensure it was generated by us | 41 -- We are being asked to verify the key, to ensure it was generated by us |
42 origin.log("debug", "verifying that dialback key is ours..."); | 42 origin.log("debug", "verifying that dialback key is ours..."); |
43 local attr = stanza.attr; | 43 local attr = stanza.attr; |
44 if attr.type then | |
45 module:log("warn", "Ignoring incoming session from %s claiming a dialback key for %s is %s", | |
46 origin.from_host or "(unknown)", attr.from or "(unknown)", attr.type); | |
47 return true; | |
48 end | |
44 -- COMPAT: Grr, ejabberd breaks this one too?? it is black and white in XEP-220 example 34 | 49 -- COMPAT: Grr, ejabberd breaks this one too?? it is black and white in XEP-220 example 34 |
45 --if attr.from ~= origin.to_host then error("invalid-from"); end | 50 --if attr.from ~= origin.to_host then error("invalid-from"); end |
46 local type; | 51 local type; |
47 if verify_dialback(attr.id, attr.from, attr.to, stanza[1]) then | 52 if verify_dialback(attr.id, attr.from, attr.to, stanza[1]) then |
48 type = "valid" | 53 type = "valid" |