def _norm_checksum(self, checksum): checksum = super(bcrypt, self)._norm_checksum(checksum) if not checksum: return None changed, checksum = bcrypt64.check_repair_unused(checksum) if changed: warn( "encountered a bcrypt hash with incorrectly set padding bits; " "you may want to use bcrypt.normhash() " "to fix this; see Passlib 1.5.3 changelog.", PasslibHashWarning) return checksum
def _norm_salt(self, salt, **kwds): salt = super(bcrypt, self)._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; see Passlib 1.5.3 changelog.", PasslibHashWarning) return salt