def set(self, user, password): self._read() if not self.users.has_key(user): raise ValueError, "No such user" s, v = SRP.new_passwd(user, password) self.users[user] = {"s": s, "v": v} self._dump()
def add(self, user, password): self._read() if self.users.has_key(user): raise ValueError, "User exists" s, v = SRP.new_passwd(user, password) self.users[user] = {"s": s, "v": v} self._dump()
def set(self, user, password): self._read() if not self.users.has_key(user): raise ValueError, 'No such user' s, v = SRP.new_passwd(user, password) self.users[user] = {'s': s, 'v': v} self._dump()
def add(self, user, password): self._read() if self.users.has_key(user): raise ValueError, 'User exists' s, v = SRP.new_passwd(user, password) self.users[user] = {'s': s, 'v': v} self._dump()
def set_password(self, s, password): socket = self.socket[s] salt, v = SRP.new_passwd(self.co.user, password) cypherv = crypt(long_to_string(v), socket['key'])[0] self._send_msg(s, {'op': 'set password', 's': salt, 'v': cypherv}) socket['state'] = 5 self.rs.listen_forever(self.nh) self.rs.doneflag.clear()