Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3835 from krombel/fix_3821
Browse files Browse the repository at this point in the history
fix VOIP crashes under Python 3
  • Loading branch information
hawkowl authored Sep 12, 2018
2 parents 33716c4 + 3572a20 commit 546aee7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/3835.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix VOIP crashes under Python 3 (#3821)
6 changes: 5 additions & 1 deletion synapse/rest/client/v1/voip.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def on_GET(self, request):
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.
Expand Down

0 comments on commit 546aee7

Please sign in to comment.