def _norm_salt(cls, salt, **kwds):
salt = super(_BcryptCommon, cls)._norm_salt(salt, **kwds)
assert salt is not None, "HasSalt didn't generate new salt!"
changed, salt = bcrypt64.check_repair_unused(salt)
if changed:
# FIXME: if salt was provided by user, this message won't be
# correct. not sure if we want to throw error, or use different warning.
warn(
"encountered a bcrypt salt with incorrectly set padding bits; "
"you may want to use bcrypt.normhash() "
"to fix this; this will be an error under Passlib 2.0",
PasslibHashWarning)
return salt
评论列表
文章目录