From 6d1828cbe5986b270eecd7437f86bd06912e8784 Mon Sep 17 00:00:00 2001 From: Maxime Bombar Date: Sat, 24 Nov 2018 16:06:55 +0100 Subject: [PATCH] Fix issue #182 --- re2o/login.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/re2o/login.py b/re2o/login.py index 0b552239..4d201d60 100644 --- a/re2o/login.py +++ b/re2o/login.py @@ -73,7 +73,11 @@ def hash_password_salt(hashed_password): if hashed_password.upper().startswith('{CRYPT}'): hashed_password = hashed_password[7:] if hashed_password.startswith('$'): - return '$'.join(hashed_password.split('$')[:-1]) + res = '$'.join(hashed_password.split('$')[:-1]) + if res: + return res + else: + return hashed_password.split('$')[-1] else: return hashed_password[:2] elif hashed_password.upper().startswith('{SSHA}'):