diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2019-06-11 15:51:00 +0100 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2019-06-11 20:14:11 +0100 |
commit | 632089940cb2a9ebdc66b1f443ab8905daee074d (patch) | |
tree | 79b9d8fe9aa1719148fbf2183dc8eab709626e23 /deluge/ui/web | |
parent | 5d7db3e727d3f9b9ba42a5aaedf925fde6146c9d (diff) | |
download | deluge-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')
-rw-r--r-- | deluge/ui/web/auth.py | 2 |
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() |