equal
deleted
inserted
replaced
50 # passlib 1.5 wants calc_checksum, 1.6 wants _calc_checksum |
50 # passlib 1.5 wants calc_checksum, 1.6 wants _calc_checksum |
51 def calc_checksum(self, secret): |
51 def calc_checksum(self, secret): |
52 return md5crypt(secret, self.salt.encode('ascii')).decode('utf-8') |
52 return md5crypt(secret, self.salt.encode('ascii')).decode('utf-8') |
53 _calc_checksum = calc_checksum |
53 _calc_checksum = calc_checksum |
54 |
54 |
55 _CRYPTO_CTX = CryptContext(['sha512_crypt', CustomMD5Crypt, 'des_crypt', 'ldap_salted_sha1']) |
55 _CRYPTO_CTX = CryptContext(['sha512_crypt', CustomMD5Crypt, 'des_crypt', 'ldap_salted_sha1'], |
|
56 deprecated=['cubicwebmd5crypt', 'des_crypt']) |
|
57 verify_and_update = _CRYPTO_CTX.verify_and_update |
56 |
58 |
57 def crypt_password(passwd, salt=None): |
59 def crypt_password(passwd, salt=None): |
58 """return the encrypted password using the given salt or a generated one |
60 """return the encrypted password using the given salt or a generated one |
59 """ |
61 """ |
60 if salt is None: |
62 if salt is None: |