server/utils.py
changeset 10681 4383f5a30504
parent 10678 77333ec71fab
child 10907 9ae707db5265
--- a/server/utils.py	Tue Sep 15 18:21:33 2015 +0200
+++ b/server/utils.py	Tue Sep 15 18:22:41 2015 +0200
@@ -64,7 +64,7 @@
     """return the encrypted password using the given salt or a generated one
     """
     if salt is None:
-        return _CRYPTO_CTX.encrypt(passwd)
+        return _CRYPTO_CTX.encrypt(passwd).encode('ascii')
     # empty hash, accept any password for backwards compat
     if salt == '':
         return salt
@@ -74,7 +74,7 @@
     except ValueError: # e.g. couldn't identify hash
         pass
     # wrong password
-    return ''
+    return b''
 
 
 def eschema_eid(cnx, eschema):