diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 2a7dc3d07..c9b876fe6 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -417,7 +417,7 @@ class Preferences(component.Component): def set_config(self): """Sets all altered config values in the core""" - import sha + import hashlib # Get the values from the dialog new_core_config = {} new_gtkui_config = {} @@ -520,8 +520,8 @@ class Preferences(component.Component): self.glade.get_widget("chk_start_in_tray").get_active() new_gtkui_config["lock_tray"] = \ self.glade.get_widget("chk_lock_tray").get_active() - passhex = sha.new(self.glade.get_widget("txt_tray_password").get_text())\ - .hexdigest() + passhex = hashlib.sha1(\ + self.glade.get_widget("txt_tray_password").get_text()).hexdigest() if passhex != "c07eb5a8c0dc7bb81c217b67f11c3b7a5e95ffd7": new_gtkui_config["tray_password"] = passhex new_gtkui_config["classic_mode"] = \ diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py index 70e883890..5db5689af 100644 --- a/deluge/ui/gtkui/systemtray.py +++ b/deluge/ui/gtkui/systemtray.py @@ -336,7 +336,7 @@ class SystemTray(component.Component): self.build_tray_bwsetsubmenu() def unlock_tray(self, is_showing_dlg=[False]): - import sha + import hashlib log.debug("Show tray lock dialog") result = False @@ -363,8 +363,8 @@ window, please enter your password")) tray_lock.vbox.pack_start(entered_pass) tray_lock.show_all() if tray_lock.run() == gtk.RESPONSE_ACCEPT: - if self.config["tray_password"] == sha.new(entered_pass.get_text())\ - .hexdigest(): + if self.config["tray_password"] == hashlib.sha1(\ + entered_pass.get_text()).hexdigest(): result = True tray_lock.destroy() is_showing_dlg[0] = False