def test(self, username, password_token): if username not in self.usernames: return False full_token = self.usernames[username] dummy, magic, salt, hashed_password = full_token.split('$') expected = md5crypt.md5crypt(password_token, salt, '$'+magic+'$') return expected==full_token
def test(self, username, password_token): ui = self.usernames.get(username) if not ui: return False expected = md5crypt.md5crypt(password_token, ui["salt"], '$' + ui["magic"] + '$') return expected == ui["token"]
def test(self, username, password_token): ui = self.usernames.get(username) if not ui: return False expected = md5crypt.md5crypt(password_token, ui["salt"], '$'+ui["magic"]+'$') return expected==ui["token"]