Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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"]
Exemplo n.º 3
0
 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"]