Tests for user consent resource (#4140)

This commit is contained in:
Amber Brown 2018-11-06 05:53:44 +11:00 committed by GitHub
parent 5a63589e80
commit efdcbbe46b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 140 additions and 6 deletions

View file

@ -227,7 +227,7 @@ class ConsentResource(Resource):
key=self._hmac_secret,
msg=userid.encode('utf-8'),
digestmod=sha256,
).hexdigest()
).hexdigest().encode('ascii')
if not compare_digest(want_mac, userhmac):
raise SynapseError(http_client.FORBIDDEN, "HMAC incorrect")