Complete refactor of TOTP integration

* Eliminate TOTP logic from GUI elements
* Consolidate TOTP functionality under the Totp namespace
* Eliminate guessing about state and encoders
* Increased test cases
* Add entry view column for TOTP [#2132]
* General code cleanup, reduction of unnecessary steps, separation of concerns
* Rename SetupTotpDialog to TotpSetupDialog for consistency
This commit is contained in:
Jonathan White 2018-09-05 16:20:57 -04:00
parent b74fb3e208
commit 1dc9f10c7f
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
21 changed files with 585 additions and 716 deletions

View file

@ -37,24 +37,23 @@ class TotpDialog : public QDialog
Q_OBJECT
public:
explicit TotpDialog(DatabaseWidget* parent = nullptr, Entry* entry = nullptr);
~TotpDialog();
private:
double uCounter;
quint8 m_step = Totp::defaultStep;
QScopedPointer<Ui::TotpDialog> m_ui;
QPointer<QTimer> m_totpUpdateTimer;
explicit TotpDialog(QWidget* parent = nullptr, Entry* entry = nullptr);
~TotpDialog() override;
private Q_SLOTS:
void updateTotp();
void updateProgressBar();
void updateSeconds();
void copyToClipboard();
double resetCounter();
protected:
private:
QScopedPointer<Ui::TotpDialog> m_ui;
void resetCounter();
Entry* m_entry;
int m_counter;
uint m_step;
QTimer m_totpUpdateTimer;
};
#endif // KEEPASSX_TOTPDIALOG_H