projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ea07e1d
)
mod_dialback: Keep the same dialback secret across module reloads
author
Kim Alvefur
<zash@zash.se>
Thu, 3 Jul 2014 13:38:53 +0000
(15:38 +0200)
committer
Kim Alvefur
<zash@zash.se>
Thu, 3 Jul 2014 13:38:53 +0000
(15:38 +0200)
plugins/mod_dialback.lua
patch
|
blob
|
history
diff --git
a/plugins/mod_dialback.lua
b/plugins/mod_dialback.lua
index b32160c474c3c67b4391f0610985320a5d997280..2959358bed945182839d2c39cfe759539742638f 100644
(file)
--- a/
plugins/mod_dialback.lua
+++ b/
plugins/mod_dialback.lua
@@
-19,7
+19,15
@@
local xmlns_stream = "http://etherx.jabber.org/streams";
local dialback_requests = setmetatable({}, { __mode = 'v' });
local dialback_requests = setmetatable({}, { __mode = 'v' });
-local dialback_secret = module.host .. (module:get_option_string("dialback_secret") or uuid_gen());
+local dialback_secret = module.host .. module:get_option_string("dialback_secret", uuid_gen());
+
+function module.save()
+ return { dialback_secret = dialback_secret };
+end
+
+function module.restore(state)
+ dialback_secret = state.dialback_secret;
+end
function generate_dialback(id, to, from)
return sha256_hash(id..to..dialback_secret, true);
function generate_dialback(id, to, from)
return sha256_hash(id..to..dialback_secret, true);