def test_password_hash_consistency_with_no_salt(self): hash_passwd = passwd.hash_pw('password', saltf=passwd.get_salt_dummy) hash_auth = authentication.ssha_hash('', 'password', hash_passwd) self.assertEquals(hash_passwd, hash_auth)
def assertUserPassword(self, username, password): line = self.find_user_line(username) _, pwu, group = line.split(':', 2) pw = authentication.ssha_hash(username, password, pwu) self.assertEquals(pw, pwu)