Skip to content

Commit 0ee1c93

Browse files
committed
Update encryption to SHA512 to work with Debian
1 parent 955ae70 commit 0ee1c93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

editor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
ROOT = '/var/www/public/'
3131
HOME = '/'
3232
from crypt import crypt
33-
PASSWD_FILE = '/etc/passwd'
33+
PASSWD_FILE = '/etc/shadow'
3434
CONFIG_FILE = '/var/www/editor/static/editor.conf'
3535
IFCONFIG = 'ifconfig'
3636
# End environment definitions
@@ -118,8 +118,8 @@ def auth():
118118
# Validate password
119119
pw = request.form['password']
120120
hash = get_hash('root')
121-
salt = hash[0:2]
122-
if crypt(pw, salt) == hash:
121+
salt = hash[3:11]
122+
if crypt(pw, '$6$' + salt) == hash:
123123
if login_user(USER_NAMES['rascal']):
124124
flash('Logged in!')
125125
return redirect(request.args.get('next') or '/')

0 commit comments

Comments
 (0)