Commit 216be42b authored by Moritz Langenstein's avatar Moritz Langenstein
Browse files

(ml5717) Fixed TURN server username for UUIDs

parent 1e44fad4
...@@ -144,7 +144,7 @@ function signalbuddy(server, config) { ...@@ -144,7 +144,7 @@ function signalbuddy(server, config) {
function getTurnServers(username) { function getTurnServers(username) {
// See https://github.com/coturn/coturn/wiki/turnserver#turn-rest-api for details // See https://github.com/coturn/coturn/wiki/turnserver#turn-rest-api for details
var acting_ice_turn_username = Math.floor(Date.now() / 1000) + config.ice.turn.timeout + "-" + username; var acting_ice_turn_username = Math.floor(Date.now() / 1000) + config.ice.turn.timeout + "-" + username.replace(/-/g, "");
var acting_ice_turn_password = _crypto2.default.createHmac('sha1', config.ice.turn.secret).update(acting_ice_turn_username).digest('base64'); var acting_ice_turn_password = _crypto2.default.createHmac('sha1', config.ice.turn.secret).update(acting_ice_turn_username).digest('base64');
return [(0, _normalice2.default)('turn:' + acting_ice_turn_username + ':' + acting_ice_turn_password + '@' + config.ice.host + ':' + config.ice.port)]; return [(0, _normalice2.default)('turn:' + acting_ice_turn_username + ':' + acting_ice_turn_password + '@' + config.ice.host + ':' + config.ice.port)];
......
...@@ -126,7 +126,7 @@ function signalbuddy(server, config) { ...@@ -126,7 +126,7 @@ function signalbuddy(server, config) {
function getTurnServers(username) { function getTurnServers(username) {
// See https://github.com/coturn/coturn/wiki/turnserver#turn-rest-api for details // See https://github.com/coturn/coturn/wiki/turnserver#turn-rest-api for details
const acting_ice_turn_username = (Math.floor(Date.now() / 1000) + config.ice.turn.timeout) + "-" + username const acting_ice_turn_username = (Math.floor(Date.now() / 1000) + config.ice.turn.timeout) + "-" + username.replace(/-/g, "")
const acting_ice_turn_password = crypto.createHmac('sha1', config.ice.turn.secret).update(acting_ice_turn_username).digest('base64') const acting_ice_turn_password = crypto.createHmac('sha1', config.ice.turn.secret).update(acting_ice_turn_username).digest('base64')
return [normalice(`turn:${acting_ice_turn_username}:${acting_ice_turn_password}@${config.ice.host}:${config.ice.port}`)] return [normalice(`turn:${acting_ice_turn_username}:${acting_ice_turn_password}@${config.ice.host}:${config.ice.port}`)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment