Commit e34877ab authored by Sidnei da Silva's avatar Sidnei da Silva

- Revert to sha1. Andreas said he added SHA256 to AuthEncoding but I can't find it.

parent c216b718
...@@ -168,12 +168,12 @@ def get_inituser(): ...@@ -168,12 +168,12 @@ def get_inituser():
def write_inituser(fn, user, password): def write_inituser(fn, user, password):
import binascii import binascii
try: try:
from hashlib import sha256 as sha from hashlib import sha1 as sha
except: except:
from sha import new as sha from sha import new as sha
fp = open(fn, "w") fp = open(fn, "w")
pw = binascii.b2a_base64(sha(password).digest())[:-1] pw = binascii.b2a_base64(sha(password).digest())[:-1]
fp.write('%s:{SHA256}%s\n' % (user, pw)) fp.write('%s:{SHA}%s\n' % (user, pw))
fp.close() fp.close()
os.chmod(fn, 0644) os.chmod(fn, 0644)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment