mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04: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;
|
bool blocking = i & true;
|
||||||
int slot = i >> 1;
|
int slot = i >> 1;
|
||||||
auto key = QSharedPointer<YkChallengeResponseKey>(new YkChallengeResponseKey(slot, blocking));
|
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);
|
m_key.addChallengeResponseKey(key);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -241,15 +239,3 @@ void ChangeMasterKeyWidget::setCancelEnabled(bool enabled)
|
|||||||
{
|
{
|
||||||
m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(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 noYubikeyFound();
|
||||||
void challengeResponseGroupToggled(bool checked);
|
void challengeResponseGroupToggled(bool checked);
|
||||||
void pollYubikey();
|
void pollYubikey();
|
||||||
void showYubiKeyPopup();
|
|
||||||
void hideYubiKeyPopup();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QScopedPointer<Ui::ChangeMasterKeyWidget> m_ui;
|
const QScopedPointer<Ui::ChangeMasterKeyWidget> m_ui;
|
||||||
|
@ -214,8 +214,6 @@ CompositeKey DatabaseOpenWidget::databaseKey()
|
|||||||
bool blocking = i & true;
|
bool blocking = i & true;
|
||||||
int slot = i >> 1;
|
int slot = i >> 1;
|
||||||
auto key = QSharedPointer<YkChallengeResponseKey>(new YkChallengeResponseKey(slot, blocking));
|
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);
|
masterKey.addChallengeResponseKey(key);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -266,18 +264,6 @@ void DatabaseOpenWidget::pollYubikey()
|
|||||||
QtConcurrent::run(YubiKey::instance(), &YubiKey::detect);
|
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)
|
void DatabaseOpenWidget::yubikeyDetected(int slot, bool blocking)
|
||||||
{
|
{
|
||||||
YkChallengeResponseKey yk(slot, blocking);
|
YkChallengeResponseKey yk(slot, blocking);
|
||||||
|
@ -53,8 +53,6 @@ protected:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void openDatabase();
|
virtual void openDatabase();
|
||||||
void showYubiKeyPopup();
|
|
||||||
void hideYubiKeyPopup();
|
|
||||||
void reject();
|
void reject();
|
||||||
|
|
||||||
private slots:
|
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 displayGlobalMessage(const QString& text, MessageWidget::MessageType type);
|
||||||
void displayTabMessage(const QString& text, MessageWidget::MessageType type);
|
void displayTabMessage(const QString& text, MessageWidget::MessageType type);
|
||||||
void hideGlobalMessage();
|
void hideGlobalMessage();
|
||||||
|
void showYubiKeyPopup();
|
||||||
|
void hideYubiKeyPopup();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent* event) override;
|
void closeEvent(QCloseEvent* event) override;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "core/Tools.h"
|
#include "core/Tools.h"
|
||||||
#include "crypto/CryptoHash.h"
|
#include "crypto/CryptoHash.h"
|
||||||
#include "crypto/Random.h"
|
#include "crypto/Random.h"
|
||||||
|
#include "gui/MainWindow.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
@ -32,6 +33,9 @@ YkChallengeResponseKey::YkChallengeResponseKey(int slot, bool blocking)
|
|||||||
: m_slot(slot),
|
: m_slot(slot),
|
||||||
m_blocking(blocking)
|
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
|
QByteArray YkChallengeResponseKey::rawKey() const
|
||||||
|
Loading…
Reference in New Issue
Block a user