aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-05-30 17:25:24 +0100
committerGravatar jesopo2019-05-30 17:25:24 +0100
commit0e6bcb5af0ad69155f60ba6eb655a82227db0a25 (patch)
tree35f252650a77e5e5583b0633c24c569c4205b8d7 /modules
parentMove python version check to the top of start.py (diff)
signature
Hex-encode master passwords, instead of b64, to avoid "strange" chars
Diffstat (limited to 'modules')
-rw-r--r--modules/permissions/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/permissions/__init__.py b/modules/permissions/__init__.py
index 3075af6a..b53ff875 100644
--- a/modules/permissions/__init__.py
+++ b/modules/permissions/__init__.py
@@ -1,7 +1,7 @@
#--depends-on commands
#--depends-on config
-import base64, os
+import base64, binascii, os
import scrypt
from src import ModuleManager, utils
@@ -52,12 +52,12 @@ class Module(ModuleManager.BaseModule):
return hash, salt
def _random_string(self, n):
- return base64.b64encode(os.urandom(n)).decode("utf8")
def _make_salt(self):
- return self._random_string(64)
+ return base64.b64encode(os.urandom(64)).decode("utf8")
+
def _random_password(self):
- return self._random_string(32)
+ return binascii.hexlify(os.urandom(32)).decode("utf8")
def _make_hash(self, password, salt=None):
salt = salt or self._make_salt()