Beispiel #1
0
 def _norm_checksum(self, checksum, relaxed=False):
     checksum = super(_BcryptCommon, self)._norm_checksum(checksum, relaxed=relaxed)
     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; this will be an error under Passlib 2.0",
             PasslibHashWarning)
     return checksum
Beispiel #2
0
 def _norm_checksum(self, checksum, relaxed=False):
     checksum = super(_BcryptCommon, self)._norm_checksum(checksum, relaxed=relaxed)
     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; this will be an error under Passlib 2.0",
             PasslibHashWarning)
     return checksum
Beispiel #3
0
 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
Beispiel #4
0
 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