diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-09-24 14:48:40 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-09-24 14:48:40 +0100 |
commit | 3a94124a52653ee80a5292b553e674f9a9529cb0 (patch) | |
tree | ae2fb9970f84da6ac1ebac19022a44a722ed4ace /synapse/rest/client/v1/voip.py | |
parent | 923fa66a30bc2a80fb0bc58fda129f3521e0200d (diff) |
Imported Upstream version 0.33.5
Diffstat (limited to 'synapse/rest/client/v1/voip.py')
-rw-r--r-- | synapse/rest/client/v1/voip.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/voip.py b/synapse/rest/client/v1/voip.py index 62f4c3d9..53da905e 100644 --- a/synapse/rest/client/v1/voip.py +++ b/synapse/rest/client/v1/voip.py @@ -42,7 +42,11 @@ class VoipRestServlet(ClientV1RestServlet): expiry = (self.hs.get_clock().time_msec() + userLifetime) / 1000 username = "%d:%s" % (expiry, requester.user.to_string()) - mac = hmac.new(turnSecret, msg=username, digestmod=hashlib.sha1) + mac = hmac.new( + turnSecret.encode(), + msg=username.encode(), + digestmod=hashlib.sha1 + ) # We need to use standard padded base64 encoding here # encode_base64 because we need to add the standard padding to get the # same result as the TURN server. |