Skip to content

Commit

Permalink
Need to make sure we encode strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
feanil committed Sep 19, 2019
1 parent 79fc35b commit 3372c82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions edx_proctoring/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ def obscured_user_id(user_id, *extra):
Any extra information can be added to the hash
"""
obs_hash = hmac.new(settings.SECRET_KEY.encode('ascii'), digestmod=hashlib.sha1)
obs_hash.update(user_id.encode('utf-8'))
obs_hash.update(b''.join(ext.encode('utf-8') for ext in extra))
obs_hash.update(six.text_type(user_id).encode('utf-8'))
obs_hash.update(b''.join(six.text_type(ext).encode('utf-8') for ext in extra))
return obs_hash.hexdigest()


Expand Down

0 comments on commit 3372c82

Please sign in to comment.