# HG changeset patch # User Kim Alvefur # Date 1577138479 -3600 # Node ID 915c7bd5f7549c1dbc51262d8ace3051a0fa8f72 # Parent 22f02716819f9cba3827b03b7f2caf401eacc81d mod_turncredentials: Rename variable for clarity diff -r 22f02716819f -r 915c7bd5f754 mod_turncredentials/mod_turncredentials.lua --- 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()