summary refs log tree commit diff
diff options
context:
space:
mode:
authorKrombel <krombel@krombel.de>2018-09-10 14:30:08 +0200
committerKrombel <krombel@krombel.de>2018-09-10 14:30:08 +0200
commit7bc22539ffb8375f92a1b26f6b4cdcfcfa9efd9a (patch)
treec75ad50c9982f0ccd5fdb74dbd5556e984b8da7f
parentMerge pull request #3810 from matrix-org/erikj/send_tags_down_sync_on_join (diff)
downloadsynapse-7bc22539ffb8375f92a1b26f6b4cdcfcfa9efd9a.tar.xz
fix VOIP crashes under Python 3 (#3821)
-rw-r--r--synapse/rest/client/v1/voip.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/voip.py b/synapse/rest/client/v1/voip.py
index 62f4c3d93e..53da905eea 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.