comparison mod_turncredentials/mod_turncredentials.lua @ 1108:2da546139cb5

mod_turncredentials: Import HMAC from util.hashes
author Kim Alvefur <zash@zash.se>
date Thu, 11 Jul 2013 16:51:27 +0200
parents 95ab35ef52ba
children 0b6b33688b75
comparison
equal deleted inserted replaced
1107:04cf0b75fe2a 1108:2da546139cb5
1 -- XEP-0215 implementation for time-limited turn credentials 1 -- XEP-0215 implementation for time-limited turn credentials
2 -- Copyright (C) 2012-2013 Philipp Hancke 2 -- Copyright (C) 2012-2013 Philipp Hancke
3 -- This file is MIT/X11 licensed. 3 -- This file is MIT/X11 licensed.
4 4
5 local st = require "util.stanza"; 5 local st = require "util.stanza";
6 local hmac_sha1 = require "util.hmac".sha1; 6 local hmac_sha1 = require "util.hashes".hmac_sha1;
7 local base64 = require "util.encodings".base64; 7 local base64 = require "util.encodings".base64;
8 local os_time = os.time; 8 local os_time = os.time;
9 local secret = module:get_option("turncredentials_secret") or false; 9 local secret = module:get_option("turncredentials_secret") or false;
10 local host = module:get_option("turncredentials_host") or false -- use ip addresses here to avoid further dns lookup latency 10 local host = module:get_option("turncredentials_host") or false -- use ip addresses here to avoid further dns lookup latency
11 local port = module:get_option("turncredentials_port") or 3478 11 local port = module:get_option("turncredentials_port") or 3478