mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-16 10:53:51 +01:00
fix VOIP crashes under Python 3 (#3821)
This commit is contained in:
parent
9a5ea511b5
commit
7bc22539ff
1 changed files with 5 additions and 1 deletions
|
@ -42,7 +42,11 @@ class VoipRestServlet(ClientV1RestServlet):
|
||||||
expiry = (self.hs.get_clock().time_msec() + userLifetime) / 1000
|
expiry = (self.hs.get_clock().time_msec() + userLifetime) / 1000
|
||||||
username = "%d:%s" % (expiry, requester.user.to_string())
|
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
|
# We need to use standard padded base64 encoding here
|
||||||
# encode_base64 because we need to add the standard padding to get the
|
# encode_base64 because we need to add the standard padding to get the
|
||||||
# same result as the TURN server.
|
# same result as the TURN server.
|
||||||
|
|
Loading…
Reference in a new issue