TURN: The timestamp is actually the expiry time

Make sure to add the TTL to the current time, so the generated expiry
time is in the future.
This commit is contained in:
Calvin Walton 2015-03-05 16:27:30 -05:00
parent dfa9fd00e2
commit 0a6d03ca79

View File

@ -24,8 +24,8 @@ public class TurnServer {
TurnEntry turn = null;
try {
Long timestamp = System.currentTimeMillis() / 1000;
String username = timestamp + COLON + userId;
long expiryTime = System.currentTimeMillis() / 1000 + ttl;
String username = expiryTime + COLON + userId;
String password = calculateRFC2104HMAC(username, secretKey);
turn = new TurnEntry(username, password, ttl, url);
} catch (SignatureException e) {