# HG changeset patch # User Kim Alvefur # Date 1512473168 -3600 # Node ID 891239e7e8966162086d79e73bd321deea6cfba5 # Parent 90962ef41bf3a2d5de992b09715d1b720b74b385# Parent 1d0862814bfcd27f734e167299b151b152d6d7fb Merge 0.10->trunk diff -r 90962ef41bf3 -r 891239e7e896 plugins/mod_dialback.lua --- a/plugins/mod_dialback.lua Tue Dec 05 11:59:43 2017 +0100 +++ b/plugins/mod_dialback.lua Tue Dec 05 12:26:08 2017 +0100 @@ -14,7 +14,6 @@ local sha256_hash = require "util.hashes".sha256; local sha256_hmac = require "util.hashes".hmac_sha256; local nameprep = require "util.encodings".stringprep.nameprep; -local check_cert_status = module:depends"s2s".check_cert_status; local uuid_gen = require"util.uuid".generate; local xmlns_stream = "http://etherx.jabber.org/streams"; @@ -24,6 +23,19 @@ local dialback_secret = sha256_hash(module:get_option_string("dialback_secret", uuid_gen()), true); local dwd = module:get_option_boolean("dialback_without_dialback", false); +--- Helper to check that a session peer's certificate is valid +function check_cert_status(session) + local host = session.direction == "outgoing" and session.to_host or session.from_host + local conn = session.conn:socket() + local cert + if conn.getpeercertificate then + cert = conn:getpeercertificate() + end + + return module:fire_event("s2s-check-certificate", { host = host, session = session, cert = cert }); +end + + function module.save() return { dialback_secret = dialback_secret }; end diff -r 90962ef41bf3 -r 891239e7e896 plugins/mod_limits.lua --- a/plugins/mod_limits.lua Tue Dec 05 11:59:43 2017 +0100 +++ b/plugins/mod_limits.lua Tue Dec 05 12:26:08 2017 +0100 @@ -1,4 +1,4 @@ --- Because we deal we pre-authed sessions and streams we can't be host-specific +-- Because we deal with pre-authed sessions and streams we can't be host-specific module:set_global(); local filters = require "util.filters";