summaryrefslogtreecommitdiffstats
path: root/deluge/ui/web/auth.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2019-06-11 15:51:00 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2019-06-11 20:14:11 +0100
commit632089940cb2a9ebdc66b1f443ab8905daee074d (patch)
tree79b9d8fe9aa1719148fbf2183dc8eab709626e23 /deluge/ui/web/auth.py
parent5d7db3e727d3f9b9ba42a5aaedf925fde6146c9d (diff)
downloaddeluge-632089940cb2a9ebdc66b1f443ab8905daee074d.tar.gz
deluge-632089940cb2a9ebdc66b1f443ab8905daee074d.tar.bz2
deluge-632089940cb2a9ebdc66b1f443ab8905daee074d.zip
[Web] Fix unable to change password
The hashlib update method requires bytes and raised a TypeError for salt passed as text. Added a test for auth change_password Fixes: #3262
Diffstat (limited to 'deluge/ui/web/auth.py')
-rw-r--r--deluge/ui/web/auth.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/deluge/ui/web/auth.py b/deluge/ui/web/auth.py
index e344eaa99..fa9504954 100644
--- a/deluge/ui/web/auth.py
+++ b/deluge/ui/web/auth.py
@@ -198,7 +198,7 @@ class Auth(JSONComponent):
"""
log.debug('Changing password')
salt = hashlib.sha1(os.urandom(32)).hexdigest()
- s = hashlib.sha1(salt)
+ s = hashlib.sha1(salt.encode('utf-8'))
s.update(new_password.encode('utf8'))
self.config['pwd_salt'] = salt
self.config['pwd_sha1'] = s.hexdigest()