Mercurial > prosody-hg
comparison plugins/mod_dialback.lua @ 11200:bf8f2da84007
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 05 Nov 2020 22:31:25 +0100 |
| parents | 18685a5e362e |
| children | 15a3db955ad3 |
comparison
equal
deleted
inserted
replaced
| 11199:6c7c50a4de32 | 11200:bf8f2da84007 |
|---|---|
| 91 | 91 |
| 92 if origin.type == "s2sin_unauthed" or origin.type == "s2sin" then | 92 if origin.type == "s2sin_unauthed" or origin.type == "s2sin" then |
| 93 -- he wants to be identified through dialback | 93 -- he wants to be identified through dialback |
| 94 -- We need to check the key with the Authoritative server | 94 -- We need to check the key with the Authoritative server |
| 95 local attr = stanza.attr; | 95 local attr = stanza.attr; |
| 96 if not attr.to or not attr.from then | |
| 97 origin.log("debug", "Missing Dialback addressing (from=%q, to=%q)", attr.from, attr.to); | |
| 98 origin:close("improper-addressing"); | |
| 99 return true; | |
| 100 end | |
| 96 local to, from = nameprep(attr.to), nameprep(attr.from); | 101 local to, from = nameprep(attr.to), nameprep(attr.from); |
| 97 | 102 |
| 98 if not hosts[to] then | 103 if not hosts[to] then |
| 99 -- Not a host that we serve | 104 -- Not a host that we serve |
| 100 origin.log("warn", "%s tried to connect to %s, which we don't serve", from, to); | 105 origin.log("warn", "%s tried to connect to %s, which we don't serve", from, to); |
| 101 origin:close("host-unknown"); | 106 origin:close("host-unknown"); |
| 102 return true; | 107 return true; |
| 103 elseif not from then | 108 elseif not from then |
| 104 origin:close("improper-addressing"); | 109 origin:close("improper-addressing"); |
| 110 return true; | |
| 105 end | 111 end |
| 106 | 112 |
| 107 if dwd and origin.secure then | 113 if dwd and origin.secure then |
| 108 if check_cert_status(origin, from) == false then | 114 if check_cert_status(origin, from) == false then |
| 109 return | 115 return |
