Merge d3a835bef6287022fcf63b097df2379ce1809aee into b4e114aac3f8b3fc95558dcc7bed163638e82a0d
This commit is contained in:
commit
758e18892c
@ -90,7 +90,7 @@ class SyncplayClient(object):
|
||||
self.setUsername(config['name'])
|
||||
self.setRoom(config['room'])
|
||||
if config['password']:
|
||||
config['password'] = hashlib.md5(config['password']).hexdigest()
|
||||
config['password'] = hashlib.sha512(config['password']).hexdigest()
|
||||
self._serverPassword = config['password']
|
||||
if not config['file']:
|
||||
self.__getUserlistOnLogon = True
|
||||
|
||||
@ -342,11 +342,11 @@ class SyncServerProtocol(JSONCommandProtocol):
|
||||
return username, serverPassword, roomName, version
|
||||
|
||||
def _checkPassword(self, serverPassword):
|
||||
if self._factory.password:
|
||||
if self._factory.password_sha512 or self._factory.password_md5:
|
||||
if not serverPassword:
|
||||
self.dropWithError(getMessage("password-required-server-error"))
|
||||
return False
|
||||
if serverPassword != self._factory.password:
|
||||
if serverPassword != self._factory.password_md5 and serverPassword != self._factory.password_sha512:
|
||||
self.dropWithError(getMessage("wrong-password-server-error"))
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -18,8 +18,10 @@ class SyncFactory(Factory):
|
||||
self.isolateRooms = isolateRooms
|
||||
print getMessage("welcome-server-notification").format(syncplay.version)
|
||||
if password:
|
||||
password = hashlib.md5(password).hexdigest()
|
||||
self.password = password
|
||||
password_sha512 = hashlib.sha512(password).hexdigest()
|
||||
password_md5 = hashlib.md5(password).hexdigest()
|
||||
self.password_sha512 = password_sha512
|
||||
self.password_md5 = password_md5
|
||||
if salt is None:
|
||||
salt = RandomStringGenerator.generate_server_salt()
|
||||
print getMessage("no-salt-notification").format(salt)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user