Пример #1
0
def verify_password(username, password):
    if not username:
        return False

    resp = g.db.execute("""select username, password from users
            where username == ?""", (username,)).fetchone()

    if not resp:
        return False

    user, b64pwd = resp

    if not user or not cryptohelper.check_pwd(password, b64pwd):
        return False

    return True
Пример #2
0
 def test_check_pwd(self):
     self.assertTrue(cryptohelper.check_pwd(self.password, self.b64str,
         rounds=self.rounds))