aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/files/radius/assha.py
diff options
context:
space:
mode:
Diffstat (limited to 'roles/space_server/files/radius/assha.py')
-rwxr-xr-xroles/space_server/files/radius/assha.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/roles/space_server/files/radius/assha.py b/roles/space_server/files/radius/assha.py
index e34c382..6d81be1 100755
--- a/roles/space_server/files/radius/assha.py
+++ b/roles/space_server/files/radius/assha.py
@@ -10,7 +10,7 @@ REXP = re.compile('^([^ ]+) ASSHA-Password := "(.*)"$')
def authorize(p):
#radiusd.radlog(radiusd.L_INFO, '*** radlog call in authorize ***')
reply = ( ('Reply-Message', 'Welcome to Labitat!'), )
- config = ( ('Auth-Type', 'python'), )
+ config = ( ('Auth-Type', 'python3'), )
return (radiusd.RLM_MODULE_OK, reply, config)
def load_users():
@@ -30,7 +30,7 @@ def check_pwd(user, pw):
assha = users[user]
crypted = assha[:40]
salt = assha[40:]
- h = hashlib.sha1('--%s--%s--' % (salt, pw)).hexdigest()
+ h = hashlib.sha1('--{}--{}--'.format(salt, pw).encode('utf-8')).hexdigest()
return h == crypted
def authenticate(p):