changeset 3773:915c7bd5f754

mod_turncredentials: Rename variable for clarity
author Kim Alvefur <zash@zash.se>
date Mon, 23 Dec 2019 23:01:19 +0100
parents 22f02716819f
children 20346da6d241
files mod_turncredentials/mod_turncredentials.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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()