Beispiel #1
0
def store_master(master_plaintext):
    """Safely stores a derivation of the master to MASTER_PW_PATH for checking against."""
    _mkdir_p(MASTER_PW_DIR)
    with os.fdopen(os.open(MASTER_PW_PATH, os.O_WRONLY | os.O_CREAT, 0600),
                   'w') as f:
        f.write(alg.make_storeable(master_plaintext))
Beispiel #2
0
def store_master(master_plaintext):
    """Safely stores a derivation of the master to MASTER_PW_PATH for checking against."""
    _mkdir_p(MASTER_PW_DIR)
    with os.fdopen(os.open(MASTER_PW_PATH, os.O_WRONLY | os.O_CREAT, 0600), 'w') as f:
        f.write(alg.make_storeable(master_plaintext))
Beispiel #3
0
 def test_make_storeable(self):
     secret = "abcdef"
     stored = alg.make_storeable(secret)
     self.assertTrue(bcrypt.hashpw(secret, stored) == stored)
Beispiel #4
0
 def test_make_storeable(self):
     secret = "abcdef"
     stored = alg.make_storeable(secret)
     self.assertTrue(bcrypt.hashpw(secret, stored) == stored)