9 |
9 |
10 from PyQt4.QtCore import pyqtSlot |
10 from PyQt4.QtCore import pyqtSlot |
11 from PyQt4.QtGui import QDialog, QDialogButtonBox |
11 from PyQt4.QtGui import QDialog, QDialogButtonBox |
12 |
12 |
13 from .Ui_MasterPasswordEntryDialog import Ui_MasterPasswordEntryDialog |
13 from .Ui_MasterPasswordEntryDialog import Ui_MasterPasswordEntryDialog |
14 |
|
15 from Utilities.crypto.py3PBKDF2 import verifyPassword |
|
16 |
14 |
17 |
15 |
18 class MasterPasswordEntryDialog(QDialog, Ui_MasterPasswordEntryDialog): |
16 class MasterPasswordEntryDialog(QDialog, Ui_MasterPasswordEntryDialog): |
19 """ |
17 """ |
20 Class implementing a dialog to enter or change the master password. |
18 Class implementing a dialog to enter or change the master password. |
43 Private slot to update the variable parts of the UI. |
41 Private slot to update the variable parts of the UI. |
44 """ |
42 """ |
45 enable = True |
43 enable = True |
46 error = "" |
44 error = "" |
47 if self.currentPasswordEdit.isEnabled(): |
45 if self.currentPasswordEdit.isEnabled(): |
|
46 from Utilities.crypto.py3PBKDF2 import verifyPassword |
48 enable = \ |
47 enable = \ |
49 verifyPassword(self.currentPasswordEdit.text(), self.__oldPasswordHash) |
48 verifyPassword(self.currentPasswordEdit.text(), self.__oldPasswordHash) |
50 if not enable: |
49 if not enable: |
51 error = error or self.trUtf8("Wrong password entered.") |
50 error = error or self.trUtf8("Wrong password entered.") |
52 |
51 |