Example #1
0
 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()
Example #2
0
 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()
Example #3
0
 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()
Example #4
0
 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()
Example #5
0
 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()
Example #6
0
 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()