From d3d93da602f73fab79ab9d0fe2af6abccb3c31b8 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 4 Aug 2012 17:12:23 +0200 Subject: [PATCH] utils.gen.saltHash: encode string before hashing it. --- src/utils/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/gen.py b/src/utils/gen.py index ef57114db..b978bab52 100644 --- a/src/utils/gen.py +++ b/src/utils/gen.py @@ -148,7 +148,7 @@ def saltHash(password, salt=None, hash='sha'): hasher = crypt.sha elif hash == 'md5': hasher = crypt.md5 - return '|'.join([salt, hasher(salt + password).hexdigest()]) + return '|'.join([salt, hasher((salt + password).encode('utf8')).hexdigest()]) def safeEval(s, namespace={'True': True, 'False': False, 'None': None}): """Evaluates s, safely. Useful for turning strings into tuples/lists/etc.