7 Module implementing a dialog to enter or change the master password. |
7 Module implementing a dialog to enter or change the master password. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt6.QtCore import pyqtSlot |
10 from PyQt6.QtCore import pyqtSlot |
11 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
11 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
|
12 |
|
13 from eric7.Utilities.crypto.py3PBKDF2 import verifyPassword |
12 |
14 |
13 from .Ui_MasterPasswordEntryDialog import Ui_MasterPasswordEntryDialog |
15 from .Ui_MasterPasswordEntryDialog import Ui_MasterPasswordEntryDialog |
14 |
16 |
15 |
17 |
16 class MasterPasswordEntryDialog(QDialog, Ui_MasterPasswordEntryDialog): |
18 class MasterPasswordEntryDialog(QDialog, Ui_MasterPasswordEntryDialog): |
43 Private slot to update the variable parts of the UI. |
45 Private slot to update the variable parts of the UI. |
44 """ |
46 """ |
45 enable = True |
47 enable = True |
46 error = "" |
48 error = "" |
47 if self.currentPasswordEdit.isEnabled(): |
49 if self.currentPasswordEdit.isEnabled(): |
48 from eric7.Utilities.crypto.py3PBKDF2 import verifyPassword |
|
49 |
|
50 enable = verifyPassword( |
50 enable = verifyPassword( |
51 self.currentPasswordEdit.text(), self.__oldPasswordHash |
51 self.currentPasswordEdit.text(), self.__oldPasswordHash |
52 ) |
52 ) |
53 if not enable: |
53 if not enable: |
54 error = error or self.tr("Wrong password entered.") |
54 error = error or self.tr("Wrong password entered.") |