--- a/mod_turncredentials/mod_turncredentials.lua Mon Dec 23 01:18:02 2019 +0100
+++ b/mod_turncredentials/mod_turncredentials.lua Mon Dec 23 23:01:19 2019 +0100
@@ -23,8 +23,8 @@
if origin.type ~= "c2s" then
return;
end
- local now = os_time() + ttl;
- local userpart = tostring(now);
+ local expires_at = os_time() + ttl;
+ local userpart = tostring(expires_at);
local nonce = base64.encode(hmac_sha1(secret, tostring(userpart), false));
origin.send(st.reply(stanza):tag("services", {xmlns = "urn:xmpp:extdisco:1"})
:tag("service", { type = "stun", host = host, port = ("%d"):format(port) }):up()
@@ -40,8 +40,8 @@
if origin.type ~= "c2s" then
return;
end
- local now = os_time() + ttl;
- local userpart = tostring(now);
+ local expires_at = os_time() + ttl;
+ local userpart = tostring(expires_at);
local nonce = base64.encode(hmac_sha1(secret, tostring(userpart), false));
origin.send(st.reply(stanza):tag("services", {xmlns = "urn:xmpp:extdisco:2"})
:tag("service", { type = "stun", host = host, port = ("%d"):format(port) }):up()