def test(self, user, password): the_hash = self.hash.get(user) if the_hash is None: return False if not '$' in the_hash: return self.crypt(password, the_hash[:2]) == the_hash magic, salt = the_hash[1:].split('$')[:2] magic = '$' + magic + '$' return md5crypt(password, salt, magic) == the_hash
def test(self, user, password): self.check_reload() the_hash = self.hash.get(user) if the_hash is None: return False if not "$" in the_hash: return self.crypt(password, the_hash[:2]) == the_hash magic, salt = the_hash[1:].split("$")[:2] magic = "$" + magic + "$" return md5crypt(password, salt, magic) == the_hash
def test(self, user, password): self.check_reload() the_hash = self.hash.get(user) if the_hash is None: return False if the_hash.startswith('{SHA}'): return b64encode(sha1(password).digest()) == the_hash[5:] if '$' not in the_hash: return self.crypt(password, the_hash[:2]) == the_hash magic, salt = the_hash[1:].split('$')[:2] magic = '$' + magic + '$' return md5crypt(password, salt, magic) == the_hash
def test(self, user, password): self.check_reload() the_hash = self.hash.get(user) if the_hash is None: return False if the_hash.startswith('{SHA}'): return b64encode(sha1(password).digest()) == the_hash[5:] if not '$' in the_hash: return self.crypt(password, the_hash[:2]) == the_hash magic, salt = the_hash[1:].split('$')[:2] magic = '$' + magic + '$' return md5crypt(password, salt, magic) == the_hash