deprecate MD5 in favor of SHA512

This commit is contained in:
Matt Hamilton 2016-08-22 14:31:13 -07:00
parent 80a1f2e546
commit d872c0a80f
2 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ class SyncplayClient(object):
self.setUsername(config['name']) self.setUsername(config['name'])
self.setRoom(config['room']) self.setRoom(config['room'])
if config['password']: if config['password']:
config['password'] = hashlib.md5(config['password']).hexdigest() config['password'] = hashlib.sha512(config['password']).hexdigest()
self._serverPassword = config['password'] self._serverPassword = config['password']
if not config['file']: if not config['file']:
self.__getUserlistOnLogon = True self.__getUserlistOnLogon = True
@ -1768,4 +1768,4 @@ class FileSwitchManager(object):
if self.isDirectoryInList(directoryToFind, self.mediaDirectories): if self.isDirectoryInList(directoryToFind, self.mediaDirectories):
return return
self._client.ui.showErrorMessage(getMessage("added-file-not-in-media-directory-error").format(directoryToFind)) self._client.ui.showErrorMessage(getMessage("added-file-not-in-media-directory-error").format(directoryToFind))
self.mediaDirectoriesNotFound.append(directoryToFind) self.mediaDirectoriesNotFound.append(directoryToFind)

View File

@ -17,7 +17,7 @@ class SyncFactory(Factory):
def __init__(self, password='', motdFilePath=None, isolateRooms=False, salt=None, disableReady=False): def __init__(self, password='', motdFilePath=None, isolateRooms=False, salt=None, disableReady=False):
print getMessage("welcome-server-notification").format(syncplay.version) print getMessage("welcome-server-notification").format(syncplay.version)
if password: if password:
password = hashlib.md5(password).hexdigest() password = hashlib.sha512(password).hexdigest()
self.password = password self.password = password
if salt is None: if salt is None:
salt = RandomStringGenerator.generate_server_salt() salt = RandomStringGenerator.generate_server_salt()