mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-26 07:49:50 -05:00
Show YubiKey message from MainWindow to ensure it's always shown when a challenge is generated
This commit is contained in:
parent
d6c48a5cf1
commit
b10cb1c83c
@ -177,8 +177,6 @@ void ChangeMasterKeyWidget::generateKey()
|
||||
bool blocking = i & true;
|
||||
int slot = i >> 1;
|
||||
auto key = QSharedPointer<YkChallengeResponseKey>(new YkChallengeResponseKey(slot, blocking));
|
||||
connect(key.data(), SIGNAL(userInteractionRequired()), SLOT(showYubiKeyPopup()));
|
||||
connect(key.data(), SIGNAL(userConfirmed()), SLOT(hideYubiKeyPopup()));
|
||||
m_key.addChallengeResponseKey(key);
|
||||
}
|
||||
#endif
|
||||
@ -241,15 +239,3 @@ void ChangeMasterKeyWidget::setCancelEnabled(bool enabled)
|
||||
{
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void ChangeMasterKeyWidget::showYubiKeyPopup()
|
||||
{
|
||||
KEEPASSXC_MAIN_WINDOW->displayGlobalMessage(tr("Please touch the button on your YubiKey!"), MessageWidget::Information);
|
||||
KEEPASSXC_MAIN_WINDOW->setEnabled(false);
|
||||
}
|
||||
|
||||
void ChangeMasterKeyWidget::hideYubiKeyPopup()
|
||||
{
|
||||
KEEPASSXC_MAIN_WINDOW->hideGlobalMessage();
|
||||
KEEPASSXC_MAIN_WINDOW->setEnabled(true);
|
||||
}
|
||||
|
@ -55,8 +55,6 @@ private slots:
|
||||
void noYubikeyFound();
|
||||
void challengeResponseGroupToggled(bool checked);
|
||||
void pollYubikey();
|
||||
void showYubiKeyPopup();
|
||||
void hideYubiKeyPopup();
|
||||
|
||||
private:
|
||||
const QScopedPointer<Ui::ChangeMasterKeyWidget> m_ui;
|
||||
|
@ -214,8 +214,6 @@ CompositeKey DatabaseOpenWidget::databaseKey()
|
||||
bool blocking = i & true;
|
||||
int slot = i >> 1;
|
||||
auto key = QSharedPointer<YkChallengeResponseKey>(new YkChallengeResponseKey(slot, blocking));
|
||||
connect(key.data(), SIGNAL(userInteractionRequired()), SLOT(showYubiKeyPopup()));
|
||||
connect(key.data(), SIGNAL(userConfirmed()), SLOT(hideYubiKeyPopup()));
|
||||
masterKey.addChallengeResponseKey(key);
|
||||
}
|
||||
#endif
|
||||
@ -266,18 +264,6 @@ void DatabaseOpenWidget::pollYubikey()
|
||||
QtConcurrent::run(YubiKey::instance(), &YubiKey::detect);
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::showYubiKeyPopup()
|
||||
{
|
||||
m_ui->messageWidget->showMessage(tr("Please touch the button on your YubiKey!"), MessageWidget::Information);
|
||||
KEEPASSXC_MAIN_WINDOW->setEnabled(false);
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::hideYubiKeyPopup()
|
||||
{
|
||||
m_ui->messageWidget->hideMessage();
|
||||
KEEPASSXC_MAIN_WINDOW->setEnabled(true);
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::yubikeyDetected(int slot, bool blocking)
|
||||
{
|
||||
YkChallengeResponseKey yk(slot, blocking);
|
||||
|
@ -53,8 +53,6 @@ protected:
|
||||
|
||||
protected slots:
|
||||
virtual void openDatabase();
|
||||
void showYubiKeyPopup();
|
||||
void hideYubiKeyPopup();
|
||||
void reject();
|
||||
|
||||
private slots:
|
||||
|
@ -871,3 +871,14 @@ void MainWindow::hideTabMessage()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::showYubiKeyPopup()
|
||||
{
|
||||
displayGlobalMessage(tr("Please touch the button on your YubiKey!"), MessageWidget::Information);
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
void MainWindow::hideYubiKeyPopup()
|
||||
{
|
||||
hideGlobalMessage();
|
||||
setEnabled(true);
|
||||
}
|
||||
|
@ -47,6 +47,8 @@ public Q_SLOTS:
|
||||
void displayGlobalMessage(const QString& text, MessageWidget::MessageType type);
|
||||
void displayTabMessage(const QString& text, MessageWidget::MessageType type);
|
||||
void hideGlobalMessage();
|
||||
void showYubiKeyPopup();
|
||||
void hideYubiKeyPopup();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "core/Tools.h"
|
||||
#include "crypto/CryptoHash.h"
|
||||
#include "crypto/Random.h"
|
||||
#include "gui/MainWindow.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QXmlStreamReader>
|
||||
@ -32,6 +33,9 @@ YkChallengeResponseKey::YkChallengeResponseKey(int slot, bool blocking)
|
||||
: m_slot(slot),
|
||||
m_blocking(blocking)
|
||||
{
|
||||
|
||||
connect(this, SIGNAL(userInteractionRequired()), KEEPASSXC_MAIN_WINDOW, SLOT(showYubiKeyPopup()));
|
||||
connect(this, SIGNAL(userConfirmed()), KEEPASSXC_MAIN_WINDOW, SLOT(hideYubiKeyPopup()));
|
||||
}
|
||||
|
||||
QByteArray YkChallengeResponseKey::rawKey() const
|
||||
|
Loading…
Reference in New Issue
Block a user