Ejemplo n.º 1
0
def is_correct_master(password):
    """ Returns True if the password matches the stored master, else False. """
    global session_master
    if session_master:
        return session_master == password
    stored_component = read_stored_master()
    if (stored_component is not None
            and alg.check_stored(password, stored_component)):
        return True
    return False
Ejemplo n.º 2
0
def is_correct_master(password):
    """ Returns True if the password matches the stored master, else False. """
    global session_master
    if session_master:
        return session_master == password
    stored_component = read_stored_master()
    if (stored_component is not None
        and alg.check_stored(password, stored_component)):
        return True
    return False
Ejemplo n.º 3
0
 def test_check_stored(self):
     # Test with an 11 round bcrypt.
     secret = "blowfish"
     stored = "$2y$11$Gzhmkebfiz2OapRqu/zWSOH2Wa9uAsbb4Vd5q3iKBILsMRX8MBpQa"
     self.assertTrue(alg.check_stored(secret, stored))
     self.assertFalse(alg.check_stored(secret[:-1], stored))
Ejemplo n.º 4
0
 def test_check_stored(self):
     # Test with an 11 round bcrypt.
     secret = "blowfish"
     stored = "$2y$11$Gzhmkebfiz2OapRqu/zWSOH2Wa9uAsbb4Vd5q3iKBILsMRX8MBpQa"
     self.assertTrue(alg.check_stored(secret, stored))
     self.assertFalse(alg.check_stored(secret[:-1], stored))