server/utils.py
changeset 8387 b59af20a868d
parent 8349 fdb796435d7b
child 8399 0ea4ccf1d9a6
equal deleted inserted replaced
8386:249b21722e5e 8387:b59af20a868d
    55         return to_hash_str(u'%s$%s' % (self.salt, self.checksum or u''))
    55         return to_hash_str(u'%s$%s' % (self.salt, self.checksum or u''))
    56 
    56 
    57     def calc_checksum(self, secret):
    57     def calc_checksum(self, secret):
    58         return md5crypt(secret, self.salt.encode('ascii'))
    58         return md5crypt(secret, self.salt.encode('ascii'))
    59 
    59 
    60 myctx = CryptContext(['sha512_crypt', CustomMD5Crypt, 'des_crypt'])
    60 myctx = CryptContext(['sha512_crypt', CustomMD5Crypt, 'des_crypt', 'ldap_salted_sha1'])
    61 
    61 
    62 def crypt_password(passwd, salt=None):
    62 def crypt_password(passwd, salt=None):
    63     """return the encrypted password using the given salt or a generated one
    63     """return the encrypted password using the given salt or a generated one
    64     """
    64     """
    65     if salt is None:
    65     if salt is None: