Merge 0.9.10
authorKim Alvefur <zash@zash.se>
Wed, 27 Jan 2016 00:06:30 +0100
changeset 7107 352270bc0439
parent 7103 301d58705667 (current diff)
parent 7106 5c6e78dc1864 (diff)
child 7108 01bd0ac9cf0c
Merge
--- a/plugins/mod_dialback.lua	Tue Jan 26 00:28:07 2016 +0100
+++ b/plugins/mod_dialback.lua	Wed Jan 27 00:06:30 2016 +0100
@@ -12,6 +12,7 @@
 
 local st = require "util.stanza";
 local sha256_hash = require "util.hashes".sha256;
+local sha256_hmac = require "util.hashes".hmac_sha256;
 local nameprep = require "util.encodings".stringprep.nameprep;
 
 local xmlns_stream = "http://etherx.jabber.org/streams";
@@ -19,7 +20,7 @@
 local dialback_requests = setmetatable({}, { __mode = 'v' });
 
 function generate_dialback(id, to, from)
-	return sha256_hash(id..to..from..hosts[from].dialback_secret, true);
+	return sha256_hmac(sha256_hash(hosts[from].dialback_secret), to .. ' ' .. from .. ' ' .. id, true);
 end
 
 function initiate_dialback(session)