# HG changeset patch # User Kim Alvefur # Date 1400764882 -7200 # Node ID a1da78658a82c69d6ff58226be7a597217439abf # Parent 6ddd7913913bfeb5ffdeaef7b532ebc12a48447f hostmanager, mod_dialback: Move generation of dialback secret out of core diff -r 6ddd7913913b -r a1da78658a82 core/hostmanager.lua --- a/core/hostmanager.lua Fri Jul 04 15:54:37 2014 +0200 +++ b/core/hostmanager.lua Thu May 22 15:21:22 2014 +0200 @@ -74,7 +74,6 @@ host = host; s2sout = {}; events = events_new(); - dialback_secret = configmanager.get(host, "dialback_secret") or uuid_gen(); send = host_send; modules = {}; }; diff -r 6ddd7913913b -r a1da78658a82 plugins/mod_dialback.lua --- a/plugins/mod_dialback.lua Fri Jul 04 15:54:37 2014 +0200 +++ b/plugins/mod_dialback.lua Thu May 22 15:21:22 2014 +0200 @@ -13,13 +13,16 @@ local st = require "util.stanza"; local sha256_hash = require "util.hashes".sha256; local nameprep = require "util.encodings".stringprep.nameprep; +local uuid_gen = require"util.uuid".generate; local xmlns_stream = "http://etherx.jabber.org/streams"; local dialback_requests = setmetatable({}, { __mode = 'v' }); +local dialback_secret = module.host .. (module:get_option_string("dialback_secret") or uuid_gen()); + function generate_dialback(id, to, from) - return sha256_hash(id..to..from..hosts[from].dialback_secret, true); + return sha256_hash(id..to..dialback_secret, true); end function initiate_dialback(session)