equal
deleted
inserted
replaced
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: |